From c87d09cc1c7db09b5e15c34751435a6c6fb1411e Mon Sep 17 00:00:00 2001 From: Shino Amakusa Date: Wed, 25 Nov 2015 19:23:14 +0100 Subject: [PATCH] IOCTL 80percent done --- .../shimatta_sdio-driver.c | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) 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;