Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLEHeartRateMon by
Diff: source/main.cpp
- Revision:
- 10:ac3615194d04
- Parent:
- 1:72c60abef7e7
- Child:
- 26:d7dd71a8aea1
diff -r 28cc52dc2acd -r ac3615194d04 source/main.cpp --- a/source/main.cpp Wed Oct 05 05:15:58 2016 +0100 +++ b/source/main.cpp Mon Oct 24 11:15:35 2016 +0100 @@ -14,7 +14,7 @@ * limitations under the License. */ -#include <mbed-events/events.h> +#include <events/mbed_events.h> #include <mbed.h> #include "ble/BLE.h" #include "ble/Gap.h" @@ -55,7 +55,7 @@ led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */ if (BLE::Instance().getGapState().connected) { - eventQueue.post(updateSensorValue); + eventQueue.call(updateSensorValue); } } @@ -97,20 +97,18 @@ void scheduleBleEventsProcessing(BLE::OnEventsToProcessCallbackContext* context) { BLE &ble = BLE::Instance(); - eventQueue.post(Callback<void()>(&ble, &BLE::processEvents)); + eventQueue.call(Callback<void()>(&ble, &BLE::processEvents)); } int main() { - eventQueue.post_every(500, periodicCallback); + eventQueue.call_every(500, periodicCallback); BLE &ble = BLE::Instance(); ble.onEventsToProcess(scheduleBleEventsProcessing); ble.init(bleInitComplete); - while (true) { - eventQueue.dispatch(); - } + eventQueue.dispatch_forever(); return 0; }