funzionicchia

Fork of mbed-os-example-ble-LED by STarks

Revision:
11:7404978b24e7
Parent:
2:864ddfb70a9c
Child:
27:ff1fb7b5f9ee
diff -r 47ee5a59dca0 -r 7404978b24e7 source/main.cpp
--- a/source/main.cpp	Wed Oct 05 05:16:03 2016 +0100
+++ b/source/main.cpp	Mon Oct 24 11:15:38 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 "LEDService.h"
@@ -98,20 +98,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;
 }