Skip to content

Commit 4fa765b

Browse files
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
1 parent 8a7a2a1 commit 4fa765b

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

Diff for: src/local/BLELocalDevice.cpp

+3-28
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,7 @@ BLELocalDevice::~BLELocalDevice()
5050

5151
int BLELocalDevice::begin()
5252
{
53-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
54-
// reset the NINA in BLE mode
55-
pinMode(SPIWIFI_SS, OUTPUT);
56-
pinMode(NINA_RESETN, OUTPUT);
57-
58-
digitalWrite(SPIWIFI_SS, LOW);
59-
#endif
60-
61-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
62-
digitalWrite(NINA_RESETN, HIGH);
63-
delay(100);
64-
digitalWrite(NINA_RESETN, LOW);
65-
delay(750);
66-
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
67-
// inverted reset
68-
digitalWrite(NINA_RESETN, LOW);
69-
delay(100);
70-
digitalWrite(NINA_RESETN, HIGH);
71-
delay(750);
72-
#elif defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
53+
#if defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
7354
// BT_REG_ON -> HIGH
7455
pinMode(BT_REG_ON, OUTPUT);
7556
digitalWrite(BT_REG_ON, LOW);
@@ -216,15 +197,9 @@ void BLELocalDevice::end()
216197

217198
HCI.end();
218199

219-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
220-
// disable the NINA
221-
digitalWrite(NINA_RESETN, HIGH);
222-
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
223-
// disable the NINA
224-
digitalWrite(NINA_RESETN, LOW);
225-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
200+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
226201
digitalWrite(BT_REG_ON, LOW);
227-
#endif
202+
#endif
228203
_advertisingData.clear();
229204
_scanResponseData.clear();
230205
}

0 commit comments

Comments
 (0)