Skip to content

Commit 2a8df74

Browse files
committed
MicroBitUARTService - wake up send() on disconnection - version 2!
From MicroBitBLEManager's bleDisconnectionCallback, trigger the same event as MicroBitUARTService's on_confirmation to wake up send() if it's sleeping. Fixes lancaster-university#407.
1 parent 8c2403e commit 2a8df74

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/bluetooth/MicroBitBLEManager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DEALINGS IN THE SOFTWARE.
2929
#include "MicroBitStorage.h"
3030
#include "MicroBitFiber.h"
3131
#include "MicroBitSystemTimer.h"
32+
#include "NotifyEvents.h"
3233

3334
/* The underlying Nordic libraries that support BLE do not compile cleanly with the stringent GCC settings we employ.
3435
* If we're compiling under GCC, then we suppress any warnings generated from this code (but not the rest of the DAL)
@@ -126,6 +127,7 @@ static void storeSystemAttributes(Gap::Handle_t handle)
126127
static void bleDisconnectionCallback(const Gap::DisconnectionCallbackParams_t *reason)
127128
{
128129
MicroBitEvent(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_DISCONNECTED);
130+
MicroBitEvent(MICROBIT_ID_NOTIFY, MICROBIT_UART_S_EVT_TX_EMPTY);
129131

130132
if (MicroBitBLEManager::manager)
131133
{

0 commit comments

Comments
 (0)