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:
- 13:c5f3a7d8764a
- Parent:
- 12:5e1ef2515c70
- Child:
- 29:083b9a2cb114
--- a/source/main.cpp Wed Oct 12 20:00:13 2016 +0100
+++ b/source/main.cpp Mon Oct 24 11:15:22 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"
@@ -145,20 +145,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;
}