Leon Wehmeier / Mbed OS fiasco_max32630

Dependencies:   SoftSerial MAX14690 Buffer

Fork of rtos_threading_with_callback by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers gpsTask.cpp Source File

gpsTask.cpp

00001 #include "mbed.h"
00002 #include "GPS.h"
00003 #include "rtos.h"
00004 #include "global.h"
00005 
00006 class GpsTask
00007 {
00008 public:
00009     static void run()
00010     {
00011         for (;;) {
00012             //printf("GPS task\r\n");
00013             if(gps.sample()>2)
00014             {
00015                 float lon = gps.get_dec_longitude();
00016                 printf("Sat: %u\r\n", gps.get_satelites());
00017                 printf("%3.2f\r\n", lon);
00018             }
00019             //float lon = gps.get_dec_longitude();
00020             //printf("Sat: %u\r\n", gps.get_satelites());
00021             //printf("%3.2f\r\n", lon);
00022             rtos::Thread::wait(250);
00023         }
00024     }
00025     GpsTask()
00026     {
00027         registerThread(GpsTask::run);
00028         //run();
00029     }
00030     static GPS gps;
00031 };
00032 GPS GpsTask::gps(P5_4, P5_3);
00033 
00034 // some witchcraft to register run function without touching anything outside our library
00035 static GpsTask _dummy;