BIOT
1
unsigned long start = millis();
while( millis() - start < 10*1000){ // let 10 seconds go by without impacting other cpu functions
yield;
}
Can someone please help me understand why the code above causes the watchdog to rest the esp given Im calling yield in the while loop?
Thanks
pert
2
You're actually not calling yield because you forgot the parentheses. If you change it to yield(); the problem should be solved.
This is not a function call, and has no effect in the code:
yield;
This is the correct function call:
yield();
BIOT
4
curious why the compiler didn't catch that....?
Thank you both!
If you set "Compiler warnings" to "All" in Arduino IDE, you get a warning:
warning: statement has no effect
It is not an error because it is valid C/C++ code.