Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 55c343a

Browse files
committed
fix ble end on mbed portenta boards for successfully ble restart
1 parent baa1370 commit 55c343a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/utility/HCICordioTransport.cpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "CordioHCICustomDriver.h"
5656

5757
extern BLE_NAMESPACE::CordioHCIDriver& ble_cordio_get_hci_driver();
58+
extern "C" void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len);
5859

5960
namespace BLE_NAMESPACE {
6061
struct CordioHCIHook {
@@ -236,6 +237,13 @@ void HCICordioTransportClass::end()
236237
delete bleLoopThread;
237238
bleLoopThread = NULL;
238239
}
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
239247

240248
#if !defined(TARGET_STM32H7)
241249
CordioHCIHook::getDriver().terminate();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /