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 mbed-os-example-ble-BatteryLevel by
Diff: source/main.cpp
- Revision:
- 13:eaa1343657a8
- Parent:
- 4:52bffaff7f0b
- Child:
- 29:7a6aff8c9468
diff -r 3f66683285f4 -r eaa1343657a8 source/main.cpp
--- a/source/main.cpp Wed Oct 05 05:15:32 2016 +0100
+++ b/source/main.cpp Mon Oct 24 11:15:10 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"
@@ -52,7 +52,7 @@
BLE &ble = BLE::Instance();
if (ble.gap().getState().connected) {
- eventQueue.post(updateSensorValue);
+ eventQueue.call(updateSensorValue);
}
}
@@ -99,20 +99,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, blinkCallback);
+ eventQueue.call_every(500, blinkCallback);
BLE &ble = BLE::Instance();
ble.onEventsToProcess(scheduleBleEventsProcessing);
ble.init(bleInitComplete);
- while (true) {
- eventQueue.dispatch();
- }
+ eventQueue.dispatch_forever();
return 0;
}
