We could support the P8 with just another few IFDEFs in jswrap_bangle.c and it wouldn't make it noticeably harder to understand than it is right now.
To make it worthwhile it is definitely not just about P8, and with each other watch the complexity grows (and sadly not in linear way). As for "wouldn't make it noticeably harder to understand than it is right now", well yes that is true because it is already too hard to understand so one more ifdef won't change anything :-)
I find the nrf5x bluetooth support quite complex already - it supports nrf51,52, softdevices version 2,3,4,5,6
Anyway I understand that it works for you and gets the job done so it is hard to argue about that.
I checked the https://github.com/brendena/Espruino/blob/MOD_DISPLAY/libs/banglejs
and so far I only find the _impl stuff quite odd. there is jswrap_xx for the JavaScript binding layer and the rest in .c files is of course implementation that is what the .c files are for, so I don't get why there is _impl everywhere. Will look more into how it actually works.
Even splitting the big file into more smaller ones (still with all the ifdef spaghetti) could be useful. something like jswrap_banglejs_display|touch|accel|hr|compass|gps|UI|... so that it s not so huge, the main file would just have the rest that does not belong anywhere special or is common to more
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.
To make it worthwhile it is definitely not just about P8, and with each other watch the complexity grows (and sadly not in linear way). As for "wouldn't make it noticeably harder to understand than it is right now", well yes that is true because it is already too hard to understand so one more ifdef won't change anything :-)
I find the nrf5x bluetooth support quite complex already - it supports nrf51,52, softdevices version 2,3,4,5,6
Anyway I understand that it works for you and gets the job done so it is hard to argue about that.
I checked the https://github.com/brendena/Espruino/blob/MOD_DISPLAY/libs/banglejs
and so far I only find the _impl stuff quite odd. there is jswrap_xx for the JavaScript binding layer and the rest in .c files is of course implementation that is what the .c files are for, so I don't get why there is _impl everywhere. Will look more into how it actually works.
Even splitting the big file into more smaller ones (still with all the ifdef spaghetti) could be useful. something like jswrap_banglejs_display|touch|accel|hr|compass|gps|UI|... so that it s not so huge, the main file would just have the rest that does not belong anywhere special or is common to more