mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-06 14:11:56 +00:00
Implement FatFs disk_ioctl MMC_GET_{TYPE,CSD}.
This commit is contained in:
parent
95581f8c27
commit
51b680c3bd
@ -10,6 +10,8 @@
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "diskio.h"
|
||||
|
||||
#if HAL_USE_MMC_SPI && HAL_USE_SDC
|
||||
@ -212,6 +214,12 @@ DRESULT disk_ioctl (
|
||||
case GET_SECTOR_SIZE:
|
||||
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
|
||||
return RES_OK;
|
||||
case MMC_GET_TYPE:
|
||||
*((BYTE *)buff) = SDCD1.cardmode;
|
||||
return RES_OK;
|
||||
case MMC_GET_CSD:
|
||||
memcpy(buff, &SDCD1.csd, sizeof(SDCD1.csd));
|
||||
return RES_OK;
|
||||
#if _USE_ERASE
|
||||
case CTRL_ERASE_SECTOR:
|
||||
mmcErase(&MMCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
|
||||
@ -234,6 +242,12 @@ DRESULT disk_ioctl (
|
||||
case GET_BLOCK_SIZE:
|
||||
*((DWORD *)buff) = 1; /* Unknown, TODO: implement? */
|
||||
return RES_OK;
|
||||
case MMC_GET_TYPE:
|
||||
*((BYTE *)buff) = SDCD1.cardmode;
|
||||
return RES_OK;
|
||||
case MMC_GET_CSD:
|
||||
memcpy(buff, &SDCD1.csd, sizeof(SDCD1.csd));
|
||||
return RES_OK;
|
||||
#if _USE_ERASE
|
||||
case CTRL_ERASE_SECTOR:
|
||||
sdcErase(&SDCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user