diff --git a/hardware/sdcard/diskio.c b/hardware/sdcard/diskio.c index c9644a1..b3e4541 100755 --- a/hardware/sdcard/diskio.c +++ b/hardware/sdcard/diskio.c @@ -22,7 +22,7 @@ /* Port controls (Platform dependent) */ #define CS_LOW() SD_CS_PORT &= ~(_BV(SD_CS_PIN)) /* CS=low */ #define CS_HIGH() SD_CS_PORT |= _BV(SD_CS_PIN) /* CS=high */ -#define MMC_CD (config_invert_sddetect == false ? (SD_DETECT_INPUT & _BV(SD_DETECT_PIN)) : (SD_DETECT_INPUT & ~_BV(SD_DETECT_PIN))) /* Card detected. yes:true, no:false, default:true */ +#define MMC_CD (config_invert_sddetect == false ? (SD_DETECT_INPUT & _BV(SD_DETECT_PIN)) : ((SD_DETECT_INPUT & _BV(SD_DETECT_PIN)) == 0)) /* Card detected. yes:true, no:false, default:true */ #define MMC_WP (false) /* Write protected. yes:true, no:false, default:false */ #define FCLK_SLOW() SPCR = 0x52 /* Set slow clock (F_CPU / 64) */ #define FCLK_FAST() SPCR = 0x50 /* Set fast clock (F_CPU / 2) */ @@ -579,6 +579,6 @@ void disk_timerproc(void) { } else { s |= (STA_NODISK | STA_NOINIT); /* Socket empty */ } - + Stat = s; /* Update MMC status */ }