Update fatfs_drv.c

增加异常处理,防止错误cmd值导致返回RES_OK
This commit is contained in:
David Lin
2020-04-17 12:36:30 +08:00
committed by GitHub
parent e2d16ddce9
commit 2254327f47

View File

@@ -8,6 +8,7 @@
#define SPI_FLASH_SECTOR_SIZE (4 * 1024)
#define SPI_FLASH_PAGE_SIZE 256
DSTATUS w25q64_fatfs_status(BYTE lun)
{
DSTATUS status = STA_NOINIT;
@@ -64,14 +65,14 @@ DRESULT w25q64_fatfs_write(BYTE lun, const BYTE *buff, DWORD sector, UINT count)
case GET_BLOCK_SIZE:
*(DWORD *)buff = 1;
break;
default:
return res;
}
res = RES_OK;
return res;
}
DWORD get_fattime (void)
{
return 0;