Yes, sometimes this is done in the code, although maybe it's a little confusing... The idea is
jswrap_banglejs_pwrBacklight is a function used by stuff in jswrap_banglejs.c, even if it's not actually a JS function.
At least if you see the symbol it in a listing of compiled code you know kind of where it's defined - if all you saw was pwrBacklight it wouldn't give you much hint of where it was defined.
Sometimes I use underscores for functions that are used like this, for example _jswrap_banglejs_setLocked is used by jswrap_banglejs_setLocked, but also a bunch of other functions, so maybe we could just do that in this case?
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.
Yes, sometimes this is done in the code, although maybe it's a little confusing... The idea is
jswrap_banglejs_pwrBacklight
is a function used by stuff injswrap_banglejs.c
, even if it's not actually a JS function.At least if you see the symbol it in a listing of compiled code you know kind of where it's defined - if all you saw was
pwrBacklight
it wouldn't give you much hint of where it was defined.Sometimes I use underscores for functions that are used like this, for example
_jswrap_banglejs_setLocked
is used byjswrap_banglejs_setLocked
, but also a bunch of other functions, so maybe we could just do that in this case?