-
I know having the code for all devices in the one file isn't ideal, but you may be able to add P8 support by adding less than 100 lines to jwrap_bangle, which I'd be happy to upstream.
At least at that point you should have a pretty clear idea what had to change, and so what would be sensible in terms of moving things about to make it easier.
Might be interesting to see, personally I am a bit skeptical about this approach but still it may be worth trying :-)
IMO there are already too many watches and devices supported in jwrap_bangle so in theory there should be plenty of material already there for the 'clear idea'. I fear that adding yet another one in the same way won't help anything. OTOH trying to add another one in new, different, modular way can change the trend.
Hi - well, that sounds like a great start. I'm not sure if it helps, but I just manually flash then use this in gdb:
Rather than
load
- maybeload
actually causes all the flash to be cleared, so since the elf doesn't include the softdevice it crashes?The end result you're after sounds great, but personally I feel like you're maybe making this into a huge bit of work when it may not have to be - and making vast changes to
jswrap_bangle.c
that won't be in the official version is basically going to result in the two builds getting being forked which almost feels worse than the current situation.So am I right in thinking that you're trying to port to pinetime/p8? Isn't it the case that basically all the hardware (LCD, touchscreen, accelerometer, etc) is already supported by the drivers that are built in to jswrap_bangle?
So if you defined
BANGLEJS
andBANGLEJS_P8
in theboard.py
file, and all thedevice
entries there are filled in properly, and you add an init section tojswrap_banglejs_hwinit
you should be a pretty long way towards having it working?I know having the code for all devices in the one file isn't ideal, but you may be able to add P8 support by adding less than 100 lines to jwrap_bangle, which I'd be happy to upstream.
At least at that point you should have a pretty clear idea what had to change, and so what would be sensible in terms of moving things about to make it easier.
Personally I would like to move device drivers each to their own files (for instance Puck.js/Microbit could maybe share accelerometer code with Bangle.js), but it's quite a hard problem to be able to do that in a way that is efficient and also doesn't break anything when sometimes devices work in subtly different ways.