1
0
Fork 0
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:
Zzyzx 2023-05-10 05:22:54 -07:00 committed by GitHub
parent 6e05967840
commit 922bc9d593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 0 deletions

View file

@ -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) {