Update fatfs_drv.c
增加异常处理,防止错误cmd值导致返回RES_OK
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#define SPI_FLASH_SECTOR_SIZE (4 * 1024)
|
#define SPI_FLASH_SECTOR_SIZE (4 * 1024)
|
||||||
#define SPI_FLASH_PAGE_SIZE 256
|
#define SPI_FLASH_PAGE_SIZE 256
|
||||||
|
|
||||||
DSTATUS w25q64_fatfs_status(BYTE lun)
|
DSTATUS w25q64_fatfs_status(BYTE lun)
|
||||||
{
|
{
|
||||||
DSTATUS status = STA_NOINIT;
|
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:
|
case GET_BLOCK_SIZE:
|
||||||
*(DWORD *)buff = 1;
|
*(DWORD *)buff = 1;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
res = RES_OK;
|
res = RES_OK;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DWORD get_fattime (void)
|
DWORD get_fattime (void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user