Open arms22 opened 2 years ago
I think it is better to add the #if defined(USE_TINYUSB) && defined(NRF52840)
for the Serial, if you make an PR. I will be happy to review/merge.
Update: USE_TINYUSB
seems to always defined for nrf52840, i will check this out later. If you could, please make an PR for your suggestion that will make it quicker to adopt the changes.
I just compiled it. I will make PR after the test. https://github.com/arms22/Adafruit_nRF52_Arduino/commit/1f4f503192ca4a24831a6e8ec522789c9344f78a
Is your feature request related to a problem? Please describe.
the following code causes
undefined reference to 'Adafruit_USBD_CDC::available()'
when targeting the nRF52840 boards. I understand that the header "Adafruit_TinyUSB.h" needs to be included, but I don't want to include it for power saving.This is because serialEventRun refers to Serial. https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/d75bb2a8524e7f00f725eb2ab27a8996be65e7a3/cores/nRF5/Uart.cpp#L27
How about changing the call to Serial.available to a call to the weak symbol?