[fix][bsp_common/fatfs] fix pointer assigning type in disk_ioctl function when cmd equal GET_SECTOR_SIZE or GET_BLOCK_SIZE

This commit is contained in:
jzlv 2021-10-25 15:19:47 +08:00
parent e27aedace2
commit 1ffe3b83a8
2 changed files with 4 additions and 4 deletions

View file

@ -53,12 +53,12 @@ int sd_disk_ioctl(BYTE cmd, void *buff)
break;
case GET_SECTOR_SIZE:
*(DWORD *)buff = SD_CardInfo.CardBlockSize;
*(WORD *)buff = SD_CardInfo.CardBlockSize;
result = RES_OK;
break;
case GET_BLOCK_SIZE:
*(WORD *)buff = SD_CardInfo.CardBlockSize;
*(DWORD *)buff = SD_CardInfo.CardBlockSize;
result = RES_OK;
break;

View file

@ -60,12 +60,12 @@ int usb_disk_ioctl(BYTE cmd, void *buff)
break;
case GET_SECTOR_SIZE:
*(DWORD *)buff = FLASH_BLOCK_SIZE;
*(WORD *)buff = FLASH_BLOCK_SIZE;
result = RES_OK;
break;
case GET_BLOCK_SIZE:
*(WORD *)buff = 1;
*(DWORD *)buff = 1;
result = RES_OK;
break;