Hmm - when minifying, C should get 'inlined' and removed. That's the idea anyway - and it's what all the normal Espruino modules rely on.
One thing that would stop it is if you exported C - then the minifier decides it is something that can be changed and that it can't mess with. You could try splitting your C into smaller objects - one for REG, one for MASK, etc - and that could help the minifier (or at the very least help you to narrow down what's taking the space).
After some refactoring and with the "direct to flash" option, I do now have enough ram available to keep going
The C object itself will take a bunch of space (probably at least 2 vars for each constant entry). However if (and you probably only want to do this for development) you made C a 'getter' function that returned the object, it would take basically no RAM until it was executed - obviously it's a lot slower though.
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.
Hmm - when minifying,
C
should get 'inlined' and removed. That's the idea anyway - and it's what all the normal Espruino modules rely on.One thing that would stop it is if you exported
C
- then the minifier decides it is something that can be changed and that it can't mess with. You could try splitting yourC
into smaller objects - one forREG
, one forMASK
, etc - and that could help the minifier (or at the very least help you to narrow down what's taking the space).The
C
object itself will take a bunch of space (probably at least 2 vars for each constant entry). However if (and you probably only want to do this for development) you madeC
a 'getter' function that returned the object, it would take basically no RAM until it was executed - obviously it's a lot slower though.