Skip to content

Commit f852716

Browse files
committed
Add compatibility with Giga
1 parent b40f618 commit f852716

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ sentence=Enables Bluetooth® Low Energy connectivity on the Arduino MKR WiFi 101
66
paragraph=This library supports creating a Bluetooth® Low Energy peripheral & central mode.
77
category=Communication
88
url=https://www.arduino.cc/en/Reference/ArduinoBLE
9-
architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,esp32
9+
architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,esp32,mbed_giga
1010
includes=ArduinoBLE.h

src/local/BLELocalDevice.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#ifndef BT_REG_ON
3434
#define BT_REG_ON PF_14
3535
#endif
36+
#elif defined(ARDUINO_GIGA)
37+
#ifndef BT_REG_ON
38+
#define BT_REG_ON PA_10
39+
#endif
3640
#endif
3741

3842
BLELocalDevice::BLELocalDevice()
@@ -65,7 +69,7 @@ int BLELocalDevice::begin()
6569
delay(100);
6670
digitalWrite(NINA_RESETN, HIGH);
6771
delay(750);
68-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
72+
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
6973
// BT_REG_ON -> HIGH
7074
pinMode(BT_REG_ON, OUTPUT);
7175
digitalWrite(BT_REG_ON, HIGH);
@@ -195,7 +199,7 @@ void BLELocalDevice::end()
195199
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
196200
// disable the NINA
197201
digitalWrite(NINA_RESETN, LOW);
198-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
202+
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
199203
digitalWrite(BT_REG_ON, LOW);
200204
#endif
201205
}

src/utility/HCICordioTransport.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <driver/CordioHCITransportDriver.h>
2626
#include <driver/CordioHCIDriver.h>
2727

28-
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
28+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
2929
#include "ble/BLE.h"
3030
#include <events/mbed_events.h>
3131
#endif
@@ -181,7 +181,7 @@ HCICordioTransportClass::~HCICordioTransportClass()
181181
{
182182
}
183183

184-
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
184+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
185185
events::EventQueue eventQueue(10 * EVENTS_EVENT_SIZE);
186186
void scheduleMbedBleEvents(BLE::OnEventsToProcessCallbackContext *context) {
187187
eventQueue.call(mbed::Callback<void()>(&context->ble, &BLE::processEvents));
@@ -201,7 +201,7 @@ int HCICordioTransportClass::begin()
201201
init_wsf(bufPoolDesc);
202202
#endif
203203

204-
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
204+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
205205
BLE &ble = BLE::Instance();
206206
ble.onEventsToProcess(scheduleMbedBleEvents);
207207

@@ -235,7 +235,7 @@ void HCICordioTransportClass::end()
235235
bleLoopThread = NULL;
236236
}
237237

238-
#if !defined(ARDUINO_PORTENTA_H7_M4) && !defined(ARDUINO_PORTENTA_H7_M7) && !defined(ARDUINO_NICLA_VISION)
238+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
239239
CordioHCIHook::getDriver().terminate();
240240
#endif
241241

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy