mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
gps passthrough cli command
This commit is contained in:
parent
77d455f82b
commit
c4dd556f3d
3 changed files with 38 additions and 0 deletions
26
src/gps.c
26
src/gps.c
|
@ -521,6 +521,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
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue