Cleanup sdcard info messaging.

This commit is contained in:
Dominic Clifton 2015-09-14 22:27:15 +01:00 committed by borisbstyle
parent 8f461b3942
commit 7f398cbe4b
1 changed files with 7 additions and 7 deletions

View File

@ -1506,16 +1506,16 @@ static void cliSdShowError(char *message, SD_Error error)
static void cliSdInfo(char *cmdline) {
UNUSED(cmdline);
SD_Error error;
uint8_t sdPresent = SD_Detect();
cliPrintf("sdcard %s\n", sdPresent == SD_PRESENT ? "PRESENT" : "NOT PRESENT");
if (sdPresent == SD_PRESENT) {
error = SD_Init();
cliSdShowError("SD init result", error);
if (sdPresent != SD_PRESENT) {
cliPrint("sd card not present\r\n");
return;
}
SD_Error error;
error = SD_Init();
cliSdShowError("SD init result", error);
SD_CardInfo cardInfo;
memset(&cardInfo, 0, sizeof(cardInfo));
error = SD_GetCardInfo(&cardInfo);