1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

GPS - quick hack to parse the received GPS data and update the OLED

display in GPS passthough mode.
This commit is contained in:
Dominic Clifton 2014-12-12 17:04:33 +00:00
parent 1d5c2fb13e
commit 39f9b799d3

View file

@ -48,6 +48,10 @@
#include "io/gps.h" #include "io/gps.h"
// FIXME quick hack to allow usage of the display in gps passthough mode.
void updateDisplay(void);
#ifdef GPS #ifdef GPS
extern int16_t debug[4]; extern int16_t debug[4];
@ -905,15 +909,18 @@ static bool gpsNewFrameUBLOX(uint8_t data)
break; break;
case 8: case 8:
_step = 0; _step = 0;
if (_ck_b != data) if (_ck_b != data) {
break; // bad checksum break; // bad checksum
}
if (_skip_packet) if (_skip_packet) {
break; break;
}
if (UBLOX_parse_gps()) if (UBLOX_parse_gps()) {
parsed = true; parsed = true;
} //end switch }
}
return parsed; return parsed;
} }
@ -937,10 +944,13 @@ gpsEnablePassthroughResult_e gpsEnablePassthrough(void)
LED0_OFF; LED0_OFF;
LED1_OFF; LED1_OFF;
char c;
while(1) { while(1) {
if (serialTotalBytesWaiting(gpsPort)) { if (serialTotalBytesWaiting(gpsPort)) {
LED0_ON; LED0_ON;
serialWrite(gpsPassthroughPort, serialRead(gpsPort)); c = serialRead(gpsPort);
gpsNewData(c);
serialWrite(gpsPassthroughPort, c);
LED0_OFF; LED0_OFF;
} }
if (serialTotalBytesWaiting(gpsPassthroughPort)) { if (serialTotalBytesWaiting(gpsPassthroughPort)) {
@ -948,6 +958,10 @@ gpsEnablePassthroughResult_e gpsEnablePassthrough(void)
serialWrite(gpsPort, serialRead(gpsPassthroughPort)); serialWrite(gpsPort, serialRead(gpsPassthroughPort));
LED1_OFF; LED1_OFF;
} }
if (feature(FEATURE_DISPLAY)) {
updateDisplay();
}
} }
return GPS_PASSTHROUGH_ENABLED; return GPS_PASSTHROUGH_ENABLED;
} }