Hi! There's nothing specific, because Bangle.js doesn't enforce enough separation to figure out which code was defined where.
However there is something called E.getSizeOf(object) which does a recursive scan of JS objects and returns how much data they use.
For instance E.getSizeOf(WIDGETS,1) will report each widget and how much memory it uses.
You can also use trace(WIDGETS["gpsrec"]) to dump the full contents of memory starting at that point too.
Unfortunately the problem is that everything ends up pretty interlinked - specifically when you define a function it references the Global scope (which contains everything) and that makes separating everything pretty painful. I've just made some changes so E.getSizeOf in the absolute latest firmware doesn't follow links back to the global scope, and that should give you a much better set of figures
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.
Hi! There's nothing specific, because Bangle.js doesn't enforce enough separation to figure out which code was defined where.
However there is something called
E.getSizeOf(object)
which does a recursive scan of JS objects and returns how much data they use.For instance
E.getSizeOf(WIDGETS,1)
will report each widget and how much memory it uses.You can also use
trace(WIDGETS["gpsrec"])
to dump the full contents of memory starting at that point too.Unfortunately the problem is that everything ends up pretty interlinked - specifically when you define a function it references the Global scope (which contains everything) and that makes separating everything pretty painful. I've just made some changes so
E.getSizeOf
in the absolute latest firmware doesn't follow links back to the global scope, and that should give you a much better set of figures