Put it in level 0, code it and junk it up... that way - on upload - each junk is sent to Espruio and processed, and only the final result is kept. For example:
What is taken advantage here is the fact that Espruino goes right to work on upload: it does not just parse the code, but execute it right away when a statement is complete... this is @Gordon's only option to live with as little as memory as a lot of MCs provide.
As you can see from the additional code - the standalone console.log()s and the ones inonInit(), especially the one withdump();- is that your source code is not around anymore... only the executed result is there. Oupload it has been executed because it is in level 0... similar as you enter commands in the console (left pane) of the Espruino Web IDE. Actually, it is not just *similar* but *the very same*. You can verify that by copy-pasting statement by statement into the console and you will get the same result. (For the functions you best copy-paste all lines of the function at once.) You can push it even further and purge/delete theld()` load function after it has done its job.
Now you enter in console onInit() and you get something like that as console output, which shows that your cs (chars) object is loaded and your source and load function ld are gone...
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.
Put it in level 0, code it and junk it up... that way - on upload - each junk is sent to Espruio and processed, and only the final result is kept. For example:
What is taken advantage here is the fact that Espruino goes right to work on upload: it does not just parse the code, but execute it right away when a statement is complete... this is @Gordon's only option to live with as little as memory as a lot of MCs provide.
As you can see from the additional code - the standalone
console.log()
s and the ones in
onInit()
, especially the one with
dump();
- is that your source code is not around anymore... only the executed result is there. Oupload it has been executed because it is in level 0... similar as you enter commands in the console (left pane) of the Espruino Web IDE. Actually, it is not just *similar* but *the very same*. You can verify that by copy-pasting statement by statement into the console and you will get the same result. (For the functions you best copy-paste all lines of the function at once.) You can push it even further and purge/delete the
ld()
` load function after it has done its job.Console output:
Now you enter in console
onInit()
and you get something like that as console output, which shows that your cs (chars) object is loaded and your source and load function ld are gone...Btw, what are you using this mass data for? ...image / font? ...odd length: 143 bytes each block...