Leon Wehmeier / Mbed OS fiasco_max32630

Dependencies:   SoftSerial MAX14690 Buffer

Fork of rtos_threading_with_callback by mbed_example

Revision:
3:d7ec6dc025b0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gpsTask.cpp	Fri Mar 30 10:32:10 2018 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "GPS.h"
+#include "rtos.h"
+#include "global.h"
+
+class GpsTask
+{
+public:
+    static void run()
+    {
+        for (;;) {
+            //printf("GPS task\r\n");
+            if(gps.sample()>2)
+            {
+                float lon = gps.get_dec_longitude();
+                printf("Sat: %u\r\n", gps.get_satelites());
+                printf("%3.2f\r\n", lon);
+            }
+            //float lon = gps.get_dec_longitude();
+            //printf("Sat: %u\r\n", gps.get_satelites());
+            //printf("%3.2f\r\n", lon);
+            rtos::Thread::wait(250);
+        }
+    }
+    GpsTask()
+    {
+        registerThread(GpsTask::run);
+        //run();
+    }
+    static GPS gps;
+};
+GPS GpsTask::gps(P5_4, P5_3);
+
+// some witchcraft to register run function without touching anything outside our library
+static GpsTask _dummy;
\ No newline at end of file