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

Merge pull request #8 from disq/gps_passthrough

GPS passthrough cli command
This commit is contained in:
dongie 2013-11-02 06:45:16 -07:00
commit ab6df2e317
3 changed files with 38 additions and 0 deletions

View file

@ -537,6 +537,32 @@ void gpsSetPIDs(void)
navPID_PARAM.Imax = POSHOLD_RATE_IMAX * 100;
}
int8_t gpsSetPassthrough(void)
{
if (gpsData.state != GPS_RECEIVINGDATA)
return -1;
// get rid of callback
core.gpsport->callback = NULL;
LED0_OFF;
LED1_OFF;
while(1) {
if (serialTotalBytesWaiting(core.gpsport)) {
LED0_ON;
serialWrite(core.mainport, serialRead(core.gpsport));
LED0_OFF;
}
if (serialTotalBytesWaiting(core.mainport)) {
LED1_ON;
serialWrite(core.gpsport, serialRead(core.mainport));
LED1_OFF;
}
}
}
// OK here is the onboard GPS code
////////////////////////////////////////////////////////////////////////////////////