If the board wasn't idle and didn't consume IO buffer, \x03 will be just extracted out of context. And next time idle routine will try to handle IO buffer the first thing it will see is EXEC_CTRL_C flag. No matter that there were characters before the flag was set. These chars will be processed later.
First possible solution is to add some magic to jshPushIOCharEvent so that \x03 will clear buffer. Not sure it's a good idea.
A quick fix that works is to send some trash chars, wait, and then send the expression that starts with \x03. I've made a pull request with this fix.
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.
Well, the root is here:
If the board wasn't idle and didn't consume IO buffer, \x03 will be just extracted out of context. And next time idle routine will try to handle IO buffer the first thing it will see is
EXEC_CTRL_C
flag. No matter that there were characters before the flag was set. These chars will be processed later.First possible solution is to add some magic to
jshPushIOCharEvent
so that \x03 will clear buffer. Not sure it's a good idea.A quick fix that works is to send some trash chars, wait, and then send the expression that starts with \x03. I've made a pull request with this fix.