GPS NEMA String parser library. Only supports SkyTraq Venus chip at this time.
Dependents: MTDOT-EVB-LinkCheck-AL MTDOT-BOX-EVB-Factory-Firmware-LIB-108 TelitSensorToCloud mDot_sensor_to_cloud ... more
Diff: GPSPARSER.cpp
- Revision:
- 6:2050b4795b66
- Parent:
- 4:ae35903cd8d2
- Child:
- 7:bd1013ba8afd
--- a/GPSPARSER.cpp Mon Nov 09 12:36:04 2015 -0600
+++ b/GPSPARSER.cpp Fri Dec 04 16:40:41 2015 -0600
@@ -31,8 +31,10 @@
using namespace mts;
-GPSPARSER::GPSPARSER(MTSSerial *uart)
- : _getSentenceThread(&GPSPARSER::startSentenceThread,this)
+GPSPARSER::GPSPARSER(MTSSerial *uart, NCP5623B* led)
+ : _getSentenceThread(&GPSPARSER::startSentenceThread,this),
+ _led(led),
+ _led_state(0)
{
_gps_uart = uart;
_gps_uart->baud(9600); //set GPS baud rate here
@@ -57,6 +59,7 @@
if (GPSPARSER::initGps() == 0) {
_gps_detected = true;
_getSentenceThread.signal_set(START_THREAD);
+ _led_timer.start();
printf("Started Nema Sentence Thread\r\n");
} else {
printf("No GPS detected\r\n");
@@ -203,6 +206,16 @@
printf("RX empty before all data read\r\n");
}
+ if (_led) {
+ if (_fix_status >= 2) {
+ _led->setPWM(NCP5623B::LED_3, 8);
+ } else if (_led_timer.read_ms() > 1000) {
+ _led_timer.reset();
+ _led_state = (_led_state == 0) ? 8 : 0;
+ _led->setPWM(NCP5623B::LED_3, _led_state);
+ }
+ }
+
osDelay(100);
} while(true);
@@ -414,3 +427,4 @@
{
return _msl_altitude;
}
+