...work keeps me more busy than I'd like right now, because I said I would run some of your code... did not happen yet... :
BUT: thanks to the error reported in your last post, I found what I wanted to show you in a previous pst: how to queue up runtime statuses without IDE connectivity and no console. But that is not the point. You may already have found this post / conversation about Puck sending same key repeatedly?.
It is about buttons... even though this is in PuckJS, it generally applicable. I hope this reference is of some help to you.
A guts analysis - to verify - tells me that too many thing are going on at 'same' time... - too many js execution streaks stacked up and waiting for execution... why? not clear yet. Even it may not be much that is put into the js execution queue, over time it eats up the memory...
Having studied your code before, I get no (glaring) hint that we deal with a memory leak here... I could though still be an issue. I know that you also throw out unknown connections... but may be to disable conectability altogether could be something to consider (and make it switchabel/togglable by a button on a free GPIO pin (if you still have one free). If not, you may consider to use SWButton (for bundling less used commands/button presses/functions).
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.
@ChristianW,
...work keeps me more busy than I'd like right now, because I said I would run some of your code... did not happen yet... :
BUT: thanks to the error reported in your last post, I found what I wanted to show you in a previous pst: how to queue up runtime statuses without IDE connectivity and no console. But that is not the point. You may already have found this post / conversation about Puck sending same key repeatedly?.
It is about buttons... even though this is in PuckJS, it generally applicable. I hope this reference is of some help to you.
A guts analysis - to verify - tells me that too many thing are going on at 'same' time... - too many js execution streaks stacked up and waiting for execution... why? not clear yet. Even it may not be much that is put into the js execution queue, over time it eats up the memory...
Having studied your code before, I get no (glaring) hint that we deal with a memory leak here... I could though still be an issue. I know that you also throw out unknown connections... but may be to disable conectability altogether could be something to consider (and make it switchabel/togglable by a button on a free GPIO pin (if you still have one free). If not, you may consider to use SWButton (for bundling less used commands/button presses/functions).