Leon Wehmeier / Mbed OS fiasco_max32630

Dependencies:   SoftSerial MAX14690 Buffer

Fork of rtos_threading_with_callback by mbed_example

gpsTask.cpp

Committer:
lwehmeier
Date:
2018-03-30
Revision:
3:d7ec6dc025b0

File content as of revision 3:d7ec6dc025b0:

#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;