From 11b53d3fc2bf5346bfd2d87191e20b22c5651013 Mon Sep 17 00:00:00 2001 From: Leo C Date: Tue, 23 Dec 2014 10:48:33 +0100 Subject: [PATCH] Don't expose mmc status flag 'STAT_FAST'. (Module private implemantation detail) --- avr/mmc.c | 6 +++--- include/diskio.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/avr/mmc.c b/avr/mmc.c index 80152f8..7c4da24 100644 --- 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; } /*-----------------------------------------------------------------------*/ diff --git a/include/diskio.h b/include/diskio.h index f7a764c..fee87a5 100644 --- a/include/diskio.h +++ b/include/diskio.h @@ -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() */ -- 2.39.2