From 83b636d788ff77c9024decd1c1d1e68a72b9ac95 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Mon, 4 Mar 2024 03:49:45 -0600 Subject: [PATCH 1/2] Fixes are in - Fix scanner example - Include Adafruit_TinyUSB.h for non-mbed cores --- examples/RF24/scanner/scanner.ino | 2 -- src/nrf_to_nrf.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/RF24/scanner/scanner.ino b/examples/RF24/scanner/scanner.ino index 4d2755a..9643265 100644 --- a/examples/RF24/scanner/scanner.ino +++ b/examples/RF24/scanner/scanner.ino @@ -49,8 +49,6 @@ void setup(void) { // Serial.begin(115200); - delay(5000); - printf_begin(); Serial.println(F("\n\rRF24/examples/scanner/")); // diff --git a/src/nrf_to_nrf.h b/src/nrf_to_nrf.h index d1ad6f4..e2a8dd6 100644 --- a/src/nrf_to_nrf.h +++ b/src/nrf_to_nrf.h @@ -7,6 +7,9 @@ #ifndef __nrf52840_nrf24l01_H__ #define __nrf52840_nrf24l01_H__ #include +#ifndef __MBED__ +#include "Adafruit_TinyUSB.h" //Needed for Serial.print on non-MBED enabled core +#endif #define NRF52_RADIO_LIBRARY #define DEFAULT_MAX_PAYLOAD_SIZE 32 From 04ad2babaad167c79d0e697cb741e48f7aa7919b Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Mon, 4 Mar 2024 03:56:50 -0600 Subject: [PATCH 2/2] Update src/nrf_to_nrf.h per @2bndy5 Co-authored-by: Brendan <2bndy5@gmail.com> --- src/nrf_to_nrf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nrf_to_nrf.h b/src/nrf_to_nrf.h index e2a8dd6..ab00abe 100644 --- a/src/nrf_to_nrf.h +++ b/src/nrf_to_nrf.h @@ -7,8 +7,9 @@ #ifndef __nrf52840_nrf24l01_H__ #define __nrf52840_nrf24l01_H__ #include -#ifndef __MBED__ -#include "Adafruit_TinyUSB.h" //Needed for Serial.print on non-MBED enabled core +#if !defined(__MBED__) || defined(USE_TINYUSB) +// Needed for Serial.print on non-MBED enabled or adafruit-based nRF52 cores +#include "Adafruit_TinyUSB.h" #endif #define NRF52_RADIO_LIBRARY