From 4fa765b3faf26c1a8229011d347c6f1eda9e6ab8 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Thu, 9 Jan 2025 09:56:37 +0100 Subject: [PATCH] changing paradigm for BLE local device Since in the next version for BLE we are delivering HCI commands through spi we don't need to restart the nina device for ble to run, thus removing those commands from this library --- src/local/BLELocalDevice.cpp | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/local/BLELocalDevice.cpp b/src/local/BLELocalDevice.cpp index aa4dee78..7c2ae2c7 100644 --- a/src/local/BLELocalDevice.cpp +++ b/src/local/BLELocalDevice.cpp @@ -50,26 +50,7 @@ BLELocalDevice::~BLELocalDevice() int BLELocalDevice::begin() { -#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); - - digitalWrite(SPIWIFI_SS, LOW); -#endif - -#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) - digitalWrite(NINA_RESETN, HIGH); - delay(100); - digitalWrite(NINA_RESETN, LOW); - delay(750); -#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT) - // inverted reset - digitalWrite(NINA_RESETN, LOW); - delay(100); - digitalWrite(NINA_RESETN, HIGH); - delay(750); -#elif defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) +#if defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) // BT_REG_ON -> HIGH pinMode(BT_REG_ON, OUTPUT); digitalWrite(BT_REG_ON, LOW); @@ -216,15 +197,9 @@ void BLELocalDevice::end() HCI.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) || defined(ARDUINO_NANO_RP2040_CONNECT) - // disable the NINA - digitalWrite(NINA_RESETN, LOW); -#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) +#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) digitalWrite(BT_REG_ON, LOW); -#endif +#endif _advertisingData.clear(); _scanResponseData.clear(); }