I'm using espruino -d Bangle.js -w index.js to connect to my Bangle.js in watch mode. Everytime I change the file in my local IDE, it is re-uploaded and re-executed like expected.
I've noticed that sometimes after I changed the file and it gets uploaded, the console shows
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.
Hi,
I'm using
espruino -d Bangle.js -w index.js
to connect to my Bangle.js in watch mode. Everytime I change the file in my local IDE, it is re-uploaded and re-executed like expected.I've noticed that sometimes after I changed the file and it gets uploaded, the console shows
while sometimes only
is shown, especially when I'm working on a larger file.
In the latter case, however, the state on the watch is not reset correctly and event handlers are added up. For example, this code
makes the log message appear multiple times after multiple file uploads.
When I long-press the button and then trigger a re-upload, the state is reset correctly.
Is there anything I can do to re-initialize the event handlers before each re-upload in watch mode?
Unfortunately, the small code example above does not reproduce the problem. It only happens with some larger code file.
Kind regards,
Johannes