Skip to content

Commit 54d6317

Browse files
authored
Merge pull request #319 from manchoz/add_opta_support
Add support for OPTA
2 parents 675fc91 + c0cd781 commit 54d6317

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

library.properties

+1-1
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,mbed_giga,renesas,renesas_portenta
9+
architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,esp32,mbed_giga,renesas,renesas_portenta,mbed_opta
1010
includes=ArduinoBLE.h

src/local/BLELocalDevice.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "BLELocalDevice.h"
2727

28-
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7)
28+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
2929
#ifndef BT_REG_ON
3030
#define BT_REG_ON PJ_12
3131
#endif
@@ -69,7 +69,7 @@ int BLELocalDevice::begin()
6969
delay(100);
7070
digitalWrite(NINA_RESETN, HIGH);
7171
delay(750);
72-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
72+
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
7373
// BT_REG_ON -> HIGH
7474
pinMode(BT_REG_ON, OUTPUT);
7575
digitalWrite(BT_REG_ON, HIGH);
@@ -219,7 +219,7 @@ void BLELocalDevice::end()
219219
#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_NANO_RP2040_CONNECT)
220220
// disable the NINA
221221
digitalWrite(NINA_RESETN, LOW);
222-
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA)
222+
#elif defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
223223
digitalWrite(BT_REG_ON, LOW);
224224
#endif
225225
}

src/utility/HCICordioTransport.cpp

+3-3
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) || defined(ARDUINO_GIGA)
28+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
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) || defined(ARDUINO_GIGA)
184+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
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) || defined(ARDUINO_GIGA)
204+
#if defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
205205
BLE &ble = BLE::Instance();
206206
ble.onEventsToProcess(scheduleMbedBleEvents);
207207

src/utility/HCIUartTransport.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
// SerialHCI is already defined in the variant
3030
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
3131
#define SerialHCI Serial2
32+
#elif defined(ARDUINO_OPTA)
33+
#define SerialHCI Serial3
3234
#elif defined(ARDUINO_PORTENTA_C33)
3335
#define SerialHCI Serial5
3436
#else

0 commit comments

Comments
 (0)