1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 11:00:02 +03:00

Fix a CLI status crash when no gyro present (#14524)

* CLI status fix crash when no gyro.

* Update n/a text per code review.
This commit is contained in:
mjs1441 2025-07-08 11:25:21 +01:00 committed by GitHub
parent 1743a43d19
commit 6c9e77d5b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4737,14 +4737,18 @@ static void cliStatus(const char *cmdName, char *cmdline)
}
}
#ifdef USE_SPI
if (gyroActiveDev()->gyroModeSPI != GYRO_EXTI_NO_INT) {
cliPrintf(" locked");
}
if (gyroActiveDev()->gyroModeSPI == GYRO_EXTI_INT_DMA) {
cliPrintf(" dma");
}
if (spiGetExtDeviceCount(&gyroActiveDev()->dev) > 1) {
cliPrintf(" shared");
if (!gyroActiveDev()) {
cliPrintf(" not active");
} else {
if (gyroActiveDev()->gyroModeSPI != GYRO_EXTI_NO_INT) {
cliPrintf(" locked");
}
if (gyroActiveDev()->gyroModeSPI == GYRO_EXTI_INT_DMA) {
cliPrintf(" dma");
}
if (spiGetExtDeviceCount(&gyroActiveDev()->dev) > 1) {
cliPrintf(" shared");
}
}
#endif
cliPrintLinefeed();