ソースを参照

change: fatfs的diskio.c保留sdio操作就行了

Wendal Chen 3 年 前
コミット
38a955ec6f
1 ファイル変更2 行追加114 行削除
  1. 2 114
      src/app/fatfs/diskio.c

+ 2 - 114
src/app/fatfs/diskio.c

@@ -11,9 +11,9 @@
 #include "diskio.h"		/* Declarations of disk functions */
 
 /* Definitions of physical drive number for each drive */
-#define DEV_RAM		1	/* Example: Map Ramdisk to physical drive 0 */
+// #define DEV_RAM		1	/* Example: Map Ramdisk to physical drive 0 */
 #define DEV_MMC		0	/* Example: Map MMC/SD card to physical drive 1 */
-#define DEV_USB		2	/* Example: Map USB MSD to physical drive 2 */
+// #define DEV_USB		2	/* Example: Map USB MSD to physical drive 2 */
 
 
 /*-----------------------------------------------------------------------*/
@@ -32,26 +32,11 @@ extern int wm_sd_card_set_blocklen(uint32_t blocklen);
 static uint32_t fs_rca;
 
 
-static int RAM_disk_status(void)
-{
-	return 0;
-}
-
 static int MMC_disk_status(void)
 {
 	return 0;
 }
 
-static int USB_disk_status(void)
-{
-	return 0;
-}
-
-static int RAM_disk_initialize(void)
-{
-	return 0;
-}
-
 static int MMC_disk_initialize(void)
 {
 	int ret;
@@ -69,16 +54,6 @@ end:
 	return ret;
 }
 
-static int USB_disk_initialize(void)
-{
-	return 0;
-}
-
-static int RAM_disk_read(	BYTE *buff, LBA_t sector, UINT count)
-{
-	return 0;
-}
-
 static int MMC_disk_read(	BYTE *buff, LBA_t sector, UINT count)
 {
 	int ret, i;
@@ -120,16 +95,6 @@ static int MMC_disk_read(	BYTE *buff, LBA_t sector, UINT count)
 	return ret;
 }
 
-static int USB_disk_read(	BYTE *buff, LBA_t sector, UINT count)
-{
-	return 0;
-}
-
-static int RAM_disk_write(	BYTE *buff, LBA_t sector, UINT count)
-{
-	return 0;
-}
-
 static int MMC_disk_write(	BYTE *buff, LBA_t sector, UINT count)
 {
 	int ret, i;
@@ -170,11 +135,6 @@ static int MMC_disk_write(	BYTE *buff, LBA_t sector, UINT count)
 	return ret;
 }
 
-static int USB_disk_write(	BYTE *buff, LBA_t sector, UINT count)
-{
-	return 0;
-}
-
 /*-----------------------------------------------------------------------*/
 /* adaptor layer end                                                      */
 /*-----------------------------------------------------------------------*/
@@ -191,12 +151,6 @@ DSTATUS disk_status (
 	DSTATUS stat = STA_NOINIT;
 
 	switch (pdrv) {
-	case DEV_RAM :
-		RAM_disk_status();
-
-		// translate the reslut code here
-
-		return stat;
 
 	case DEV_MMC :
 		MMC_disk_status();
@@ -204,13 +158,6 @@ DSTATUS disk_status (
 		// translate the reslut code here
 		stat &= ~STA_NOINIT;
 
-		return stat;
-
-	case DEV_USB :
-		USB_disk_status();
-
-		// translate the reslut code here
-
 		return stat;
 	}
 	return STA_NOINIT;
@@ -230,26 +177,12 @@ DSTATUS disk_initialize (
 	int result;
 
 	switch (pdrv) {
-	case DEV_RAM :
-		result = RAM_disk_initialize();
-
-		// translate the reslut code here
-
-		return stat;
-
 	case DEV_MMC :
 		result = MMC_disk_initialize();
 
 		// translate the reslut code here
 		(result == 0)?(stat &= ~STA_NOINIT):(stat = STA_NOINIT);
 
-		return stat;
-
-	case DEV_USB :
-		result = USB_disk_initialize();
-
-		// translate the reslut code here
-
 		return stat;
 	}
 	return STA_NOINIT;
@@ -272,14 +205,6 @@ DRESULT disk_read (
 	int result;
 
 	switch (pdrv) {
-	case DEV_RAM :
-		// translate the arguments here
-
-		result = RAM_disk_read(buff, sector, count);
-
-		// translate the reslut code here
-
-		return res;
 
 	case DEV_MMC :
 		// translate the arguments here
@@ -289,15 +214,6 @@ DRESULT disk_read (
 		// translate the reslut code here
 		(result == 0)?(res = RES_OK):(res = RES_ERROR);
 
-		return res;
-
-	case DEV_USB :
-		// translate the arguments here
-
-		result = USB_disk_read(buff, sector, count);
-
-		// translate the reslut code here
-
 		return res;
 	}
 
@@ -323,14 +239,6 @@ DRESULT disk_write (
 	int result;
 
 	switch (pdrv) {
-	case DEV_RAM :
-		// translate the arguments here
-
-		result = RAM_disk_write((BYTE *)buff, sector, count);
-
-		// translate the reslut code here
-
-		return res;
 
 	case DEV_MMC :
 		// translate the arguments here
@@ -340,15 +248,6 @@ DRESULT disk_write (
 		// translate the reslut code here
 		(result == 0)?(res = RES_OK):(res = RES_ERROR);
 
-		return res;
-
-	case DEV_USB :
-		// translate the arguments here
-
-		result = USB_disk_write((BYTE *)buff, sector, count);
-
-		// translate the reslut code here
-
 		return res;
 	}
 
@@ -371,11 +270,6 @@ DRESULT disk_ioctl (
 	DRESULT res = 0;
 
 	switch (pdrv) {
-	case DEV_RAM :
-
-		// Process of the command for the RAM drive
-
-		return res;
 
 	case DEV_MMC :
 
@@ -407,12 +301,6 @@ DRESULT disk_ioctl (
 				break;
 		}
 
-		return res;
-
-	case DEV_USB :
-
-		// Process of the command the USB drive
-
 		return res;
 	}