Skip to content

Commit f32c0da

Browse files
committed
Edit sd_diskio to check card status
1 parent 399f4ec commit f32c0da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: libraries/SD/src/sd_diskio.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ DSTATUS ff_sd_initialize(uint8_t pdrv)
609609

610610
DSTATUS ff_sd_status(uint8_t pdrv)
611611
{
612+
if(sdCommand(pdrv, SEND_STATUS, 0, NULL) == 0xFF)
613+
{
614+
log_e("Check status failed");
615+
return STA_NOINIT;
616+
}
612617
return s_cards[pdrv]->status;
613618
}
614619

0 commit comments

Comments
 (0)