Skip to content

Commit 12077e2

Browse files
reset events callback
1 parent b0d87ad commit 12077e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

BLE_Privacy/source/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ class PrivacyDevice : private mbed::NonCopyable<PrivacyDevice>,
7070
/* to show we're running we'll blink every 500ms */
7171
_event_queue.call_every(500, this, &PrivacyDevice::blink);
7272

73+
/* this will inform us off all events so we can schedule their handling
74+
* using our event queue */
75+
_ble.onEventsToProcess(
76+
makeFunctionPointer(this, &PrivacyDevice::schedule_ble_events)
77+
);
78+
7379
if (_ble.hasInitialized()) {
7480
/* ble instance already initialised, skip init and start activity */
7581
start();
7682
} else {
77-
/* this will inform us off all events so we can schedule their handling
78-
* using our event queue */
79-
_ble.onEventsToProcess(
80-
makeFunctionPointer(this, &PrivacyDevice::schedule_ble_events)
81-
);
82-
8383
ble_error_t error = _ble.init(this, &PrivacyDevice::on_init_complete);
8484

8585
if (error) {

0 commit comments

Comments
 (0)