2018 revision to classic DataBus AVC code.

Dependencies:   LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell

Revision:
26:2dc31a801cc8
Parent:
25:b8176ebb96c6
Child:
27:bfe141fad082
--- a/main.cpp	Fri Dec 21 20:38:55 2018 +0000
+++ b/main.cpp	Fri Dec 21 21:23:53 2018 +0000
@@ -49,6 +49,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Updater
 Updater *u = Updater::instance();
+EventQueue updaterQueue(8 * EVENTS_EVENT_SIZE);
 
 void updater_callback() {
     led1 = !led1;
@@ -180,11 +181,8 @@
     printf("Starting updater...\n");
     u->attach(updater_callback);
     Thread updaterThread(osPriorityRealtime, 512, 0, "updater");
-    EventQueue *updaterQueue = mbed_highprio_event_queue();
-    Event<void()> event(updaterQueue, callback(u, &Updater::update));
-    event.period(20);
-    event.post();
-    updaterThread.start(callback(updaterQueue, &EventQueue::dispatch_forever));
+    updaterQueue.call_every(20, u, &Updater::update);
+    updaterThread.start(callback(&updaterQueue, &EventQueue::dispatch_forever));
     
     printf("Starting gps...\n");
     Thread gpsThread(osPriorityHigh, 256, 0, "gps");
@@ -203,8 +201,6 @@
     sh.attach(read_gps, "gps");
     sh.attach(reset, "reset");
     sh.attach(stats, "stats");
-    //Thread shellThread(osPriorityNormal, 1024, 0, "shell");
-    //shellThread.start(callback(&sh, &SimpleShell::run));
     sh.run();
     
     /*