-
• #2
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:/*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.
What would be the easiest way to add the code I've written in the web IDE into a version of the firmware that I can then compile and have run when I flash the puck?
I have already compiled and flashed a custom firmware successfully. I changed the name that the puck advertises in bluetooth scans. Kudos for these excellent instructions on building
https://github.com/espruino/Espruino/blob/master/README_Building.md