Add partitioning

Also add sd mounting/unmounting
Also add vol+/- controls for sideways menus
This commit is contained in:
suchmememanyskill
2020-12-28 20:08:15 +01:00
parent baec43da2a
commit f1d433e69a
12 changed files with 225 additions and 15 deletions

View File

@@ -98,11 +98,39 @@ DRESULT disk_write (
/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions */
/*-----------------------------------------------------------------------*/
static u32 part_rsvd_size = 0;
DRESULT disk_ioctl (
BYTE pdrv, /* Physical drive number (0..) */
BYTE pdrv, /* Physical drive nmuber (0..) */
BYTE cmd, /* Control code */
void *buff /* Buffer to send/receive control data */
)
{
DWORD *buf = (DWORD *)buff;
if (pdrv == DRIVE_SD)
{
switch (cmd)
{
case GET_SECTOR_COUNT:
*buf = sd_storage.sec_cnt - part_rsvd_size;
break;
case GET_BLOCK_SIZE:
*buf = 32768; // Align to 16MB.
break;
}
}
else if (pdrv == DRIVE_RAM)
{
switch (cmd)
{
case GET_SECTOR_COUNT:
*buf = RAM_DISK_SZ >> 9; // 1GB.
break;
case GET_BLOCK_SIZE:
*buf = 2048; // Align to 1MB.
break;
}
}
return RES_OK;
}

View File

@@ -38,7 +38,7 @@
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
#define FF_USE_MKFS 0
#define FF_USE_MKFS 1
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
#define FF_FASTFS 0