endpoint C207 radio support
Dependents: mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular
Diff: MBEDUbloxGPS.cpp
- Revision:
- 17:c48b03c386fb
- Parent:
- 16:19f597d8048f
- Child:
- 19:0fcc7e5ff8a6
diff -r 19f597d8048f -r c48b03c386fb MBEDUbloxGPS.cpp --- a/MBEDUbloxGPS.cpp Mon Jun 30 22:17:48 2014 +0000 +++ b/MBEDUbloxGPS.cpp Tue Jul 01 17:12:32 2014 +0000 @@ -38,7 +38,9 @@ // default constructor MBEDUbloxGPS::MBEDUbloxGPS(ErrorHandler *error_handler, void *endpoint,void *gps) : BaseClass(error_handler,endpoint) { + #ifdef ENABLE_THREADS this->m_gps_poll_thread = NULL; + #endif this->m_gps = (GPSParser *)gps; this->m_latitude = 0; this->m_longitude = 0; @@ -47,7 +49,10 @@ // default destructor MBEDUbloxGPS::~MBEDUbloxGPS() { + #ifdef ENABLE_THREADS if (this->m_gps_poll_thread != NULL) { this->m_gps_poll_thread->terminate(); delete this->m_gps_poll_thread; } + #endif + } // update our GPS info @@ -62,10 +67,12 @@ // start the update thread and connect bool MBEDUbloxGPS::connect() { +#ifdef ENABLE_THREADS if (this->m_gps_poll_thread == NULL) { - //this->logger()->log("starting GPS update thread..."); - //this->m_gps_poll_thread = new Thread(read_gps); + this->logger()->log("starting GPS update thread..."); + this->m_gps_poll_thread = new Thread(read_gps); } +#endif return true; }