From 7018c81bf1b4f1988db197db76bf8ca62fcc158c Mon Sep 17 00:00:00 2001 From: mikeller Date: Sun, 8 Sep 2019 13:55:18 +1200 Subject: [PATCH] Fixed 'sd_info' showing incorrect information when SD card not configured. --- src/main/cli/cli.c | 6 ++++++ src/main/msp/msp.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index b2dadc5602..00d8d6082c 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -2319,6 +2319,12 @@ static void cliSdInfo(char *cmdline) cliPrint("SD card: "); + if (sdcardConfig()->mode == SDCARD_MODE_NONE) { + cliPrintLine("Not configured"); + + return; + } + if (!sdcard_isInserted()) { cliPrintLine("None inserted"); return; diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index 43029b9d0d..bdd79664ac 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -319,7 +319,7 @@ static void serializeSDCardSummaryReply(sbuf_t *dst) uint32_t totalSpace = 0; #if defined(USE_SDCARD) - if (sdcardConfig()->mode) { + if (sdcardConfig()->mode != SDCARD_MODE_NONE) { flags = MSP_SDCARD_FLAG_SUPPORTED; // Merge the card and filesystem states together