Thanks! Yes, that looks really good, and it's nice clean separation.
I wonder whether for now, we even need libs/banglejs/hardware/barometer/bangle_barometer_impl.c and the ESPR_WEAK functions - I feel like we could probably just have that in jswrap_bangle_barometer.c. I feel happier in a way if we just define all the functions in every hardware implementation file, and the compile fails if eg someone misses banglejs_barometer_off_impl.
I like pulling out the repeated I2C initialise calls to arrays (did you ever see how much flash it saves?).
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! Yes, that looks really good, and it's nice clean separation.
I wonder whether for now, we even need
libs/banglejs/hardware/barometer/bangle_barometer_impl.c
and the ESPR_WEAK functions - I feel like we could probably just have that injswrap_bangle_barometer.c
. I feel happier in a way if we just define all the functions in every hardware implementation file, and the compile fails if eg someone missesbanglejs_barometer_off_impl
.I like pulling out the repeated I2C initialise calls to arrays (did you ever see how much flash it saves?).