|
55 | 55 | #include "CordioHCICustomDriver.h"
|
56 | 56 |
|
57 | 57 | extern BLE_NAMESPACE::CordioHCIDriver& ble_cordio_get_hci_driver();
|
| 58 | +extern "C" void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len); |
58 | 59 |
|
59 | 60 | namespace BLE_NAMESPACE {
|
60 | 61 | struct CordioHCIHook {
|
@@ -236,6 +237,13 @@ void HCICordioTransportClass::end()
|
236 | 237 | delete bleLoopThread;
|
237 | 238 | bleLoopThread = NULL;
|
238 | 239 | }
|
| 240 | + // Reset the callback with the mbed-os default handler to properly handle the following CYW43xxx chip initializations and begins |
| 241 | + CordioHCIHook::setDataReceivedHandler(hciTrSerialRxIncoming); |
| 242 | + |
| 243 | +#if (defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)) && !defined(CUSTOM_HCI_DRIVER) |
| 244 | + BLE &ble = BLE::Instance(); |
| 245 | + ble.shutdown(); |
| 246 | +#endif |
239 | 247 |
|
240 | 248 | #if !defined(TARGET_STM32H7)
|
241 | 249 | CordioHCIHook::getDriver().terminate();
|
|
0 commit comments