Thanks!
There's a bit of info on adding your own libraries here: https://github.com/espruino/Espruino/blob/master/libs/README.md
I'd do that, but just add an init function that gets called automatically:
init
/*JSON{ "type" : "init", "generate" : "jswrap_foobar_init" }*/ void jswrap_foobar_init() { jsvUnLock(jspEvaluate("your_js_code_here", true)); }
The neat thing with that is that while things you define still go into RAM, the actual JS code of the functions will stay in flash memory.
I am working on another option which will let you add JS modules without using up any RAM at all, but that's still a way off being usable.
@Gordon started
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.
Thanks!
There's a bit of info on adding your own libraries here: https://github.com/espruino/Espruino/blob/master/libs/README.md
I'd do that, but just add an
init
function that gets called automatically:The neat thing with that is that while things you define still go into RAM, the actual JS code of the functions will stay in flash memory.
I am working on another option which will let you add JS modules without using up any RAM at all, but that's still a way off being usable.