mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +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:
parent
1743a43d19
commit
6c9e77d5b7
1 changed files with 12 additions and 8 deletions
|
@ -4737,14 +4737,18 @@ static void cliStatus(const char *cmdName, char *cmdline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef USE_SPI
|
#ifdef USE_SPI
|
||||||
if (gyroActiveDev()->gyroModeSPI != GYRO_EXTI_NO_INT) {
|
if (!gyroActiveDev()) {
|
||||||
cliPrintf(" locked");
|
cliPrintf(" not active");
|
||||||
}
|
} else {
|
||||||
if (gyroActiveDev()->gyroModeSPI == GYRO_EXTI_INT_DMA) {
|
if (gyroActiveDev()->gyroModeSPI != GYRO_EXTI_NO_INT) {
|
||||||
cliPrintf(" dma");
|
cliPrintf(" locked");
|
||||||
}
|
}
|
||||||
if (spiGetExtDeviceCount(&gyroActiveDev()->dev) > 1) {
|
if (gyroActiveDev()->gyroModeSPI == GYRO_EXTI_INT_DMA) {
|
||||||
cliPrintf(" shared");
|
cliPrintf(" dma");
|
||||||
|
}
|
||||||
|
if (spiGetExtDeviceCount(&gyroActiveDev()->dev) > 1) {
|
||||||
|
cliPrintf(" shared");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
cliPrintLinefeed();
|
cliPrintLinefeed();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue