It's if you want someone using the module to be able to use that constant. For example:
rtc = require(...)
rtc.foo(rtc.C.WHATEVER);
If you don't need them to be able to use it then you can make it private, and when the code is minified the minifier can then take that constant, remove it, and put the numeric value right into the I2C.writeTo statement (which will be faster and will use a bit less 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.
Thanks!
It's if you want someone using the module to be able to use that constant. For example:
If you don't need them to be able to use it then you can make it private, and when the code is minified the minifier can then take that constant, remove it, and put the numeric value right into the
I2C.writeTo
statement (which will be faster and will use a bit less memory).