mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Update gps.c
This commit is contained in:
parent
66f7e52fad
commit
df2ba31c1d
1 changed files with 14 additions and 23 deletions
|
@ -1058,6 +1058,18 @@ static bool gpsNewFrameUBLOX(uint8_t data)
|
|||
return parsed;
|
||||
}
|
||||
|
||||
static void gpsHandlePassthrough(uint8_t data)
|
||||
{
|
||||
gpsNewData(data);
|
||||
#ifdef DISPLAY
|
||||
if (feature(FEATURE_DISPLAY)) {
|
||||
updateDisplay();
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
void gpsEnablePassthrough(serialPort_t *gpsPassthroughPort)
|
||||
{
|
||||
waitForSerialPortToFinishTransmitting(gpsPort);
|
||||
|
@ -1066,34 +1078,13 @@ void gpsEnablePassthrough(serialPort_t *gpsPassthroughPort)
|
|||
if(!(gpsPort->mode & MODE_TX))
|
||||
serialSetMode(gpsPort, gpsPort->mode | MODE_TX);
|
||||
|
||||
LED0_OFF;
|
||||
LED1_OFF;
|
||||
|
||||
#ifdef DISPLAY
|
||||
if (feature(FEATURE_DISPLAY)) {
|
||||
displayShowFixedPage(PAGE_GPS);
|
||||
}
|
||||
#endif
|
||||
char c;
|
||||
while(1) {
|
||||
if (serialRxBytesWaiting(gpsPort)) {
|
||||
LED0_ON;
|
||||
c = serialRead(gpsPort);
|
||||
gpsNewData(c);
|
||||
serialWrite(gpsPassthroughPort, c);
|
||||
LED0_OFF;
|
||||
}
|
||||
if (serialRxBytesWaiting(gpsPassthroughPort)) {
|
||||
LED1_ON;
|
||||
serialWrite(gpsPort, serialRead(gpsPassthroughPort));
|
||||
LED1_OFF;
|
||||
}
|
||||
#ifdef DISPLAY
|
||||
if (feature(FEATURE_DISPLAY)) {
|
||||
updateDisplay();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
serialPassthrough(gpsPort, gpsPassthroughPort, &gpsHandlePassthrough, NULL);
|
||||
}
|
||||
|
||||
void updateGpsIndicator(uint32_t currentTime)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue