You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to avoid CPU hogging by the main thread (loop() of *.ino file) it is necessary to add rtos::ThisThread::yield(); to ArduinoCore-mbed as shown below:
for (;;) {
loop();
if (arduino::serialEventRun) arduino::serialEventRun();
+ rtos::ThisThread::yield();
}
For all *.inot defined threads this is automatically done by this code executed after calling the thread's loop() function.
Since this is currently not the case rtos::ThisThread::yield(); is currently called within the main thread of each example (i.e. here) and I think we should rather avoid exposing the raw mbed API to the wider public.