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

CLI status fix crash when no gyro.

This commit is contained in:
Matthew Selby 2025-07-04 18:50:46 +01:00
parent b6d37008f5
commit 3386af18fc

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(" none!");
} 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();