dstroy0 / InputHandler

Arduino input handler
https://dstroy0.github.io/InputHandler/
GNU General Public License v3.0
1 stars 0 forks source link

Nordic NRF compatibility #72

Open dstroy0 opened 1 year ago

dstroy0 commented 1 year ago

It needs vsnprintf_P, snprintf_P, maybe pgm_read_dword. the hook is the NRF_H macro.

dstroy0 commented 1 year ago

It looks like it will work, but their stream objects are significantly more complex to set up and differ platform-platform. So unless I want to write a stream shim they'll just have to use a buffer and figure it out on their own.

2bndy5 commented 1 year ago

What arduino core/board did you use?

dstroy0 commented 1 year ago

platformio adafruit boards pkg / NRF52840 64MHz, 243KB RAM, 796KB Flash https://github.com/dstroy0/InputHandler/actions/runs/4494426191/jobs/7906906907#step:7:145

dstroy0 commented 1 year ago

possibly relevant: https://github.com/khoih-prog/TimerInterrupt_Generic/issues/4

dstroy0 commented 1 year ago

If it's a regression in the nrf core/adafruit shims I'll figure out how to use the compatible previous version.

2bndy5 commented 1 year ago

Actually, I think its something to do with the adaruit core's use of TinyUSB: see https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/653#issuecomment-852702564

Basically you need this somewhere (probably in the lib's primary header):

#ifdef USE_TINYUSB
    #include <Adafruit_TinyUSB.h>
#endif
2bndy5 commented 1 year ago

Probably better to use something more board-specific though:

#if defined(USE_TINYUSB) && defined(ARDUINO_NRF52_ADAFRUIT)
    #include <Adafruit_TinyUSB.h>
#endif
dstroy0 commented 1 year ago

Awesome, I'll get to testing that! Thanks!