From 618fd8e8d509f7d9aacd66bd707434ec1153757f Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 1 Mar 2021 13:11:06 +0100 Subject: [PATCH 1/2] Support Nano RP2040 Connect --- src/local/BLELocalDevice.cpp | 6 +++--- src/utility/HCIUartTransport.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/local/BLELocalDevice.cpp b/src/local/BLELocalDevice.cpp index 0ca0220f..45d975a5 100644 --- a/src/local/BLELocalDevice.cpp +++ b/src/local/BLELocalDevice.cpp @@ -42,7 +42,7 @@ BLELocalDevice::~BLELocalDevice() int BLELocalDevice::begin() { -#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_NANO_33_IOT) +#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT) // reset the NINA in BLE mode pinMode(SPIWIFI_SS, OUTPUT); pinMode(NINA_RESETN, OUTPUT); @@ -55,7 +55,7 @@ int BLELocalDevice::begin() delay(100); digitalWrite(NINA_RESETN, LOW); delay(750); -#elif defined(ARDUINO_SAMD_NANO_33_IOT) +#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT) // inverted reset digitalWrite(NINA_RESETN, LOW); delay(100); @@ -131,7 +131,7 @@ void BLELocalDevice::end() #if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) // disable the NINA digitalWrite(NINA_RESETN, HIGH); -#elif defined(ARDUINO_SAMD_NANO_33_IOT) +#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT) // disable the NINA digitalWrite(NINA_RESETN, LOW); #elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) diff --git a/src/utility/HCIUartTransport.cpp b/src/utility/HCIUartTransport.cpp index 9a5f4087..ed7b2e59 100644 --- a/src/utility/HCIUartTransport.cpp +++ b/src/utility/HCIUartTransport.cpp @@ -23,7 +23,7 @@ #if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) #define SerialHCI Serial2 -#elif defined(ARDUINO_SAMD_NANO_33_IOT) +#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT) // SerialHCI is already defined in the variant #elif defined(ARDUINO_PORTENTA_H7_M4) // SerialHCI is already defined in the variant @@ -93,7 +93,7 @@ size_t HCIUartTransportClass::write(const uint8_t* data, size_t length) return result; } -#ifdef ARDUINO_AVR_UNO_WIFI_REV2 +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_NANO_RP2040_CONNECT) HCIUartTransportClass HCIUartTransport(SerialHCI, 119600); #else HCIUartTransportClass HCIUartTransport(SerialHCI, 912600); From 2ccd5ecfea81c87d5c5de2ab45906c32faa2562d Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 8 Mar 2021 13:01:42 +0100 Subject: [PATCH 2/2] RP2040: enable BLE on mbed based core --- src/utility/HCICordioTransport.cpp | 2 +- src/utility/HCIUartTransport.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utility/HCICordioTransport.cpp b/src/utility/HCICordioTransport.cpp index 3363877e..01788238 100644 --- a/src/utility/HCICordioTransport.cpp +++ b/src/utility/HCICordioTransport.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#if defined(ARDUINO_ARCH_MBED) +#if defined(ARDUINO_ARCH_MBED) && !defined(TARGET_NANO_RP2040_CONNECT) #include #include diff --git a/src/utility/HCIUartTransport.cpp b/src/utility/HCIUartTransport.cpp index ed7b2e59..67bc173f 100644 --- a/src/utility/HCIUartTransport.cpp +++ b/src/utility/HCIUartTransport.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(ARDUINO_ARCH_MBED) +#if !defined(ARDUINO_ARCH_MBED) || defined(TARGET_NANO_RP2040_CONNECT) #include "HCIUartTransport.h"