Multi tasking or realtime operating systems considerations.Often a realtime extension is used. Standard RT extensionfacilitiesIs normally services like
Std libraries with RT kernel integrationA realtime operating system or kernel may provide proper crafted drivers which handle all waiting and timeout as passive waiting, adv mailbox systems integrated with interrupt servies routine etc. It can be waiting by a semaphore or other realtime constructs. So not CPU time is wasted. BUT … If you are using krnl(by me) or arduino ports of FreeRTOS or other realtime extensions they might just use the drivers til serial, i2c etc provided as a part of the distributions. And they do use busy waiting because the drivers are written for single program use.
So beware and do a proper investigation and do not assume anything. At least look at serial driver, i2c driver, SPI driver your are going to use. Take a look here at Arduinos HW serial driver- lot of busy waiting. HardwareSerial.cpp and HardwareSerial.h Look after
Krnlhttp://github.com/jdn-aau/krnl ESP32MISSING githus link
ESP32 and freeRTOS and waitingThe ESP32 is a duo kernel CPU. The whole driver system is build around freeRTOS so - as far as I can see - they do handle interrupts, waiting etc in the right way(passive) - by use of freeRTOS calls. So waste of CPU time is minimized. BTW - Do you know Amazon own freeRTOS. They did buy it for IOT use. OTHER CPUSIf you have some info regarding these items like (serial) drivers handle busy/passive waiting etc I woul dbe happy to hear about it :-) |