Skip to content

Commit eccdbeb

Browse files
andreagilardonifabik111
authored andcommitted
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 df7c623 commit eccdbeb

1 file changed

Lines changed: 3 additions & 28 deletions

File tree

src/local/BLELocalDevice.cpp

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,7 @@ BLELocalDevice::~BLELocalDevice()
6363

6464
int BLELocalDevice::begin()
6565
{
66-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
67-
// reset the NINA in BLE mode
68-
pinMode(SPIWIFI_SS, OUTPUT);
69-
pinMode(NINA_RESETN, OUTPUT);
70-
71-
digitalWrite(SPIWIFI_SS, LOW);
72-
#endif
73-
74-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
75-
digitalWrite(NINA_RESETN, HIGH);
76-
delay(100);
77-
digitalWrite(NINA_RESETN, LOW);
78-
delay(750);
79-
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
80-
// inverted reset
81-
digitalWrite(NINA_RESETN, LOW);
82-
delay(100);
83-
digitalWrite(NINA_RESETN, HIGH);
84-
delay(750);
85-
#elif defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
66+
#if defined(PORTENTA_H7_PINS) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
8667
// BT_REG_ON -> HIGH
8768
pinMode(BT_REG_ON, OUTPUT);
8869
digitalWrite(BT_REG_ON, LOW);
@@ -221,15 +202,9 @@ void BLELocalDevice::end()
221202

222203
HCI.end();
223204

224-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
225-
// disable the NINA
226-
digitalWrite(NINA_RESETN, HIGH);
227-
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
228-
// disable the NINA
229-
digitalWrite(NINA_RESETN, LOW);
230-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
205+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
231206
digitalWrite(BT_REG_ON, LOW);
232-
#endif
207+
#endif
233208
_advertisingData.clear();
234209
_scanResponseData.clear();
235210
}

0 commit comments

Comments
 (0)