From 9f53aa13d19ab0a81c41c0b7dcfe24b3132037c9 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 13 May 2018 20:32:38 +0200 Subject: [PATCH] [stage2] Implement disk_status --- fusee/fusee-secondary/src/lib/fatfs/diskio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fusee/fusee-secondary/src/lib/fatfs/diskio.c b/fusee/fusee-secondary/src/lib/fatfs/diskio.c index 9c6644ec0..e81d44c47 100644 --- a/fusee/fusee-secondary/src/lib/fatfs/diskio.c +++ b/fusee/fusee-secondary/src/lib/fatfs/diskio.c @@ -24,7 +24,12 @@ DSTATUS disk_status ( BYTE pdrv /* Physical drive nmuber to identify the drive */ ) { - return 0; + device_partition_t *devpart = g_volume_to_devparts[pdrv]; + if (devpart == NULL) { + return STA_NODISK; + } else { + return devpart->initialized ? 0 : STA_NOINIT; + } }