You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • 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 :-)

    ~/Espruino$ grep ifdef targets/nrf5x/bluetooth.c | wc -l
    49
    ~/Espruino$ grep ifdef targets/nrf5x/jshardware.c | wc -l
    82
    ~/Espruino$ grep ifdef libs/banglejs/jswrap_bangle.c | wc -l
    312
    

    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

About

Avatar for fanoush @fanoush started