Ahh ok, I just took at look at the code. Even though the function code is in Flash I guess there are just so many functions in there it's using all the memory.
Can I suggest that you just remove functions like:
This way, the functions aren't loaded into RAM all the time. You just call gps.getUtils().getWPdistance() instead, and it's slower, but absolutely everything stayed in flash until it was needed.
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.
Ahh ok, I just took at look at the code. Even though the function code is in Flash I guess there are just so many functions in there it's using all the memory.
Can I suggest that you just remove functions like:
And just access
showTrip
directly? Literally all the getters and setters are doing here is using up memory and slowing things down.The other option you have is to do something like:
This way, the functions aren't loaded into RAM all the time. You just call
gps.getUtils().getWPdistance()
instead, and it's slower, but absolutely everything stayed in flash until it was needed.