Moving the logo out of a function should also help reduce reinitializing the var whenever it's called.
Sorry this one is bad advice... you want to define big chunks of data inside functions - because functions are stored in and executed from Flash (of which you have 4MB) whereas you only have 64k of RAM so you want to reduce the stuff you keep in that to a minimum.
Could be worth setting 'Debug Info' to 'show' in the settings page too. That way if there's an error (eg when callback is shown) when you're not connected by Bluetooth it'll write the stack trace to the screen.
The code you've got there looks good though - there doesn't seem like there would be anything that'd cause memory usage to keep increasing...
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.
This would be a good help - notes specifically for Bangle.js:
https://www.espruino.com/Bangle.js+Guidelines
and also https://www.espruino.com/Code+Style#other-suggestions
Sorry this one is bad advice... you want to define big chunks of data inside functions - because functions are stored in and executed from Flash (of which you have 4MB) whereas you only have 64k of RAM so you want to reduce the stuff you keep in that to a minimum.
Could be worth setting 'Debug Info' to 'show' in the settings page too. That way if there's an error (eg when
callback
is shown) when you're not connected by Bluetooth it'll write the stack trace to the screen.The code you've got there looks good though - there doesn't seem like there would be anything that'd cause memory usage to keep increasing...