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.
Diff: source/main.cpp
- Revision:
- 14:332bb3fa072b
- Parent:
- 6:bfe23efb0d97
- Child:
- 30:217bfc94a9b7
--- a/source/main.cpp Wed Oct 05 05:15:54 2016 +0100
+++ b/source/main.cpp Mon Oct 24 11:15:31 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"
@@ -101,7 +101,7 @@
// Calling BLE api in interrupt context may cause race conditions
// Using mbed-events to schedule calls to BLE api for safety
- eventQueue.post(updatePayload);
+ eventQueue.call(updatePayload);
}
void blinkCallback(void)
@@ -169,7 +169,7 @@
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()
@@ -185,14 +185,12 @@
}
// Blink LED every 500 ms to indicate system aliveness
- eventQueue.post_every(500, blinkCallback);
+ eventQueue.call_every(500, blinkCallback);
// Register function to be called when button is released
button.rise(buttonPressedCallback);
- while (true) {
- eventQueue.dispatch();
- }
+ eventQueue.dispatch_forever();
return 0;
}