I guess maybe there was some logging to Storage inside your setScan handler?
I store the result of setScan in an array, but inside the http handler write the log. I log not only the errors but also the exceptions. I'm trying the fix, which is interesting! I attach the memory usage graph.
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.
Glad you found the problem! I guess maybe there was some logging to Storage inside your
setScan
handler?I just had a quick go at reproducing this and it seems I can actually do it pretty easily (even on desktop) with:
I have just committed a fix for this so there should be a build ready in the next few minutes.
It may actually be that this is the cause of the vast majority of your issues (if code that was stored in flash is no longer being executed correctly)