]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Don't expose mmc status flag 'STAT_FAST'. (Module private implemantation detail) hexrel-4.2
authorLeo C <erbl259-lmu@yahoo.de>
Tue, 23 Dec 2014 09:48:33 +0000 (10:48 +0100)
committerLeo C <erbl259-lmu@yahoo.de>
Tue, 23 Dec 2014 09:48:33 +0000 (10:48 +0100)
avr/mmc.c
include/diskio.h

index 80152f83500483b6f442cef4d235195f11e14571..7c4da2451ec48370fb66e2538ead48909ed7e079 100644 (file)
--- a/avr/mmc.c
+++ b/avr/mmc.c
@@ -450,7 +450,7 @@ DSTATUS disk_initialize (
        if (drv >= MAX_DRV)
                return STA_NOINIT; /* Supports only single drive */
        if (socket[drv].stat & STA_NODISK)
-               return socket[drv].stat; /* No card in the socket */
+               return socket[drv].stat & STAT_MASK; /* No card in the socket */
 
        power_on(drv); /* Force socket power on */
        socket[drv].stat &= ~STA_FAST;
@@ -505,7 +505,7 @@ DSTATUS disk_initialize (
                power_off(drv);
        }
 
-       return socket[drv].stat;
+       return socket[drv].stat & STAT_MASK;
 }
 
 /*-----------------------------------------------------------------------*/
@@ -518,7 +518,7 @@ DSTATUS disk_status (
 {
        if (drv >= MAX_DRV)
                return STA_NOINIT;
-       return socket[drv].stat;
+       return socket[drv].stat & STAT_MASK;
 }
 
 /*-----------------------------------------------------------------------*/
index f7a764ca765402174f8f872e446327c8b3629cd8..fee87a536438b4fb057de1647e200d447ed964e6 100644 (file)
@@ -46,6 +46,7 @@ void disk_timerproc (void);
 #define STA_NODISK             0x02    /* No medium in the drive */
 #define STA_PROTECT            0x04    /* Write protected */
 #define STA_FAST               0x08    /* Fast SPI clock */
+#define STAT_MASK              (STA_NOINIT | STA_NODISK | STA_PROTECT)
 
 
 /* Command code for disk_ioctrl() */