mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Add GPS Status Line to CLI Status Output (#12769)
* Add GPS status line to cli status output: connected status, UART + serial port baud + configured baud, configured status. * Fixed unit test link fail. * Really fixed unit test link fail (I hope). * Really fixed unit test link fail (no really this time). * Updated to address code reviews. * Updated to address code reviews. * Updated to address code reviews.
This commit is contained in:
parent
6e05967840
commit
922bc9d593
4 changed files with 54 additions and 0 deletions
|
@ -4731,6 +4731,45 @@ static void cliStatus(const char *cmdName, char *cmdline)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_GPS
|
||||
cliPrint("GPS: ");
|
||||
if (featureIsEnabled(FEATURE_GPS)) {
|
||||
if (gpsIsHealthy()) {
|
||||
cliPrint("connected, ");
|
||||
} else {
|
||||
cliPrint("NOT CONNECTED, ");
|
||||
}
|
||||
if (gpsConfig()->provider == GPS_MSP) {
|
||||
cliPrint("MSP, ");
|
||||
} else {
|
||||
const serialPortConfig_t *gpsPortConfig = findSerialPortConfig(FUNCTION_GPS);
|
||||
if (!gpsPortConfig) {
|
||||
cliPrint("NO PORT, ");
|
||||
} else {
|
||||
cliPrintf("UART%d %ld (set to ", (gpsPortConfig->identifier + 1), baudRates[getGpsPortActualBaudRateIndex()]);
|
||||
if (gpsConfig()->autoBaud == GPS_AUTOBAUD_ON) {
|
||||
cliPrint("AUTO");
|
||||
} else {
|
||||
cliPrintf("%ld", baudRates[gpsPortConfig->gps_baudrateIndex]);
|
||||
}
|
||||
cliPrint("), ");
|
||||
}
|
||||
}
|
||||
if (!gpsIsHealthy()) {
|
||||
cliPrint("NOT CONFIGURED");
|
||||
} else {
|
||||
if (gpsConfig()->autoConfig == GPS_AUTOCONFIG_OFF) {
|
||||
cliPrint("auto config OFF");
|
||||
} else {
|
||||
cliPrint("configured");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cliPrint("NOT ENABLED");
|
||||
}
|
||||
cliPrintLinefeed();
|
||||
#endif // USE_GPS
|
||||
|
||||
cliPrint("Arming disable flags:");
|
||||
armingDisableFlags_e flags = getArmingDisableFlags();
|
||||
while (flags) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue