I was trying to get around saving the module to flash since it would be written to RAM anyway
Ahh - that's not actually the case. If you do the Storage option (or 'Save on Send': http://www.espruino.com/Saving) then the code is stored in flash and executed from there, so it doesn't use much RAM at all.
Even if you use the normal 'save()' the code stored in ROM is stored compressed, so is actually pretty dense. GPS is super small anyway though (789 bytes!).
are there some commands to tell the puck that the module code should be in a separate namespace/module
I'm not sure I really understand the question...
If you actually want to load everything into RAM from your own app, you might find it's easier to use the command-line tools with the -o file.js option - they'll wrap all the needed code together for you (using Modules.addCached, which is the solution for messing around with exports) and then write it to a JS file. You can then take that file and upload it from your app, and job done :)
You could also try and add some external hardware - if you have 2 data pins free you could add an I2C EEPROM/flash memory which could give you a megabyte or more of memory.
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 - that's not actually the case. If you do the Storage option (or 'Save on Send': http://www.espruino.com/Saving) then the code is stored in flash and executed from there, so it doesn't use much RAM at all.
Even if you use the normal 'save()' the code stored in ROM is stored compressed, so is actually pretty dense. GPS is super small anyway though (789 bytes!).
I'm not sure I really understand the question...
If you actually want to load everything into RAM from your own app, you might find it's easier to use the command-line tools with the
-o file.js
option - they'll wrap all the needed code together for you (usingModules.addCached
, which is the solution for messing around withexports
) and then write it to a JS file. You can then take that file and upload it from your app, and job done :)If you're trying to save memory, you could take a look at using the built-in compression library to compress the data you save: http://www.espruino.com/Reference#t_heatÂshrink
You could also try and add some external hardware - if you have 2 data pins free you could add an I2C EEPROM/flash memory which could give you a megabyte or more of memory.