aboutsummaryrefslogtreecommitdiffstats
path: root/os/various
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-08-07 18:50:39 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-08-07 18:50:39 -0300
commit2fb40b504f7596b154dc4cc940b222790ea1f580 (patch)
treea2e8074c633e05e38e591dc0f455f013497418ee /os/various
parentd72557da5a5144819e493cd0f16480b1f67b2226 (diff)
downloadChibiOS-Contrib-2fb40b504f7596b154dc4cc940b222790ea1f580.tar.gz
ChibiOS-Contrib-2fb40b504f7596b154dc4cc940b222790ea1f580.tar.bz2
ChibiOS-Contrib-2fb40b504f7596b154dc4cc940b222790ea1f580.zip
USBH: Fix compile with FATFS 0.12b
Diffstat (limited to 'os/various')
-rw-r--r--os/various/fatfs_bindings/fatfs_diskio.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/os/various/fatfs_bindings/fatfs_diskio.c b/os/various/fatfs_bindings/fatfs_diskio.c
index 6949310..9fa41e2 100644
--- a/os/various/fatfs_bindings/fatfs_diskio.c
+++ b/os/various/fatfs_bindings/fatfs_diskio.c
@@ -180,7 +180,6 @@ DRESULT disk_read (
/*-----------------------------------------------------------------------*/
/* Write Sector(s) */
-#if _USE_WRITE
DRESULT disk_write (
BYTE pdrv, /* Physical drive nmuber (0..) */
const BYTE *buff, /* Data to be written */
@@ -226,14 +225,12 @@ DRESULT disk_write (
}
return RES_PARERR;
}
-#endif /* _USE_WRITE */
/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions */
-#if _USE_IOCTL
DRESULT disk_ioctl (
BYTE pdrv, /* Physical drive nmuber (0..) */
BYTE cmd, /* Control code */
@@ -246,11 +243,13 @@ DRESULT disk_ioctl (
switch (cmd) {
case CTRL_SYNC:
return RES_OK;
+#if _MAX_SS > _MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
return RES_OK;
-#if _USE_ERASE
- case CTRL_ERASE_SECTOR:
+#endif
+#if _USE_TRIM
+ case CTRL_TRIM:
mmcErase(&MMCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
return RES_OK;
#endif
@@ -265,14 +264,16 @@ DRESULT disk_ioctl (
case GET_SECTOR_COUNT:
*((DWORD *)buff) = mmcsdGetCardCapacity(&SDCD1);
return RES_OK;
+#if _MAX_SS > _MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
return RES_OK;
+#endif
case GET_BLOCK_SIZE:
*((DWORD *)buff) = 256; /* 512b blocks in one erase block */
return RES_OK;
-#if _USE_ERASE
- case CTRL_ERASE_SECTOR:
+#if _USE_TRIM
+ case CTRL_TRIM:
sdcErase(&SDCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
return RES_OK;
#endif
@@ -288,12 +289,14 @@ DRESULT disk_ioctl (
case GET_SECTOR_COUNT:
*((DWORD *)buff) = MSBLKD[0].info.blk_num;
return RES_OK;
+#if _MAX_SS > _MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MSBLKD[0].info.blk_size;
return RES_OK;
-#if _USE_ERASE
+#endif
+#if _USE_TRIM
#error "unimplemented yet!"
-// case CTRL_ERASE_SECTOR:
+// case CTRL_TRIM:
// ....
// return RES_OK;
#endif
@@ -304,7 +307,6 @@ DRESULT disk_ioctl (
}
return RES_PARERR;
}
-#endif /* _USE_IOCTL */
DWORD get_fattime(void) {
#if HAL_USE_RTC
@@ -316,5 +318,3 @@ DWORD get_fattime(void) {
return ((uint32_t)0 | (1 << 16)) | (1 << 21); /* wrong but valid time */
#endif
}
-
-