Skip to content

Commit 858ff26

Browse files
committed
fix: Sd2Card init return value
Signed-off-by: Frederic Pillon <[email protected]>
1 parent ec95e06 commit 858ff26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/Sd2Card.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ bool Sd2Card::init(uint32_t detect, uint32_t level)
7474
}
7575
}
7676
#endif
77-
if ((status == true) && (BSP_SD_Init() == MSD_OK)) {
78-
status = BSP_SD_GetCardInfo(&_SdCardInfo);
77+
if (status == true) {
78+
if (BSP_SD_Init() == MSD_OK) {
79+
status = BSP_SD_GetCardInfo(&_SdCardInfo);
80+
} else {
81+
status = false;
82+
}
7983
}
8084
return status;
8185
}

0 commit comments

Comments
 (0)