@Unreality this experiment is creating a true Unreality! ;-)
Did you catch the bold text just beneath that code snippet from the link provided?
"Note: The above code is NOT recommended."
Forcing the processor to block other requested scheduled tasks is a bad practice, as you have discovered. A forced break/exit is most likely by design as this article points out:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Mon 2019.06.17
@Unreality this experiment is creating a true
Unreality
! ;-)Did you catch the bold text just beneath that code snippet from the link provided?
Forcing the processor to block other requested scheduled tasks is a bad practice, as you have discovered. A forced break/exit is most likely by design as this article points out:
The datasheet for your particular processor may have an explanation also.
The original snippet using
setTimeout
is the recommended way to go.What is the true purpose, an attempt to make Javascript instructions look pretty?