diff --git a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c index 0dc9e50..cbe94dd 100644 --- a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c +++ b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c @@ -55,7 +55,27 @@ DRESULT SDIO_disk_write(const BYTE *buff, DWORD sector, UINT count){ return RES_OK; } DRESULT SDIO_disk_ioctl(BYTE cmd, void* buff){ - return RES_OK; + DRESULT res = RES_OK; + switch(cmd) { + case GET_BLOCK_SIZE: + *((DWORD*)buff) = 0x01; + break; + case GET_SECTOR_SIZE: + *((WORD*)buff) = (1<STA & SDIO_STA_CMDREND) break; //Corrct Respone Received + if (SDIO->STA & SDIO_STA_CMDREND) break; //Correct Respone Received //Exclude ACMD41 from valid CRC check if ((SDIO->STA & SDIO_STA_CCRCFAIL)) { @@ -151,9 +171,9 @@ int SDIO_getResp(uint8_t expectedCMD, uint8_t typeOfAns, uint32_t *responseBuffe //Valid Respone Received if ((SDIO->RESPCMD & SDIO_RESPCMD_RESPCMD) != expectedCMD) return -1; //Not the expected respose - //Correct Response + //If case of a correct Response *(responseBuffer++) = SDIO->RESP1; - //Long response. Never needed with SD Cards + //Long response. if (typeOfAns == LONG_ANS) { *(responseBuffer++) = SDIO->RESP2; *(responseBuffer++) = SDIO->RESP3;