mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-05 19:51:45 +00:00
Fix diskio.c, etc.
This commit is contained in:
parent
bf3eea7031
commit
9a86ffec68
3 changed files with 4 additions and 5 deletions
|
@ -86,7 +86,6 @@ const char *VolumeStr[FF_VOLUMES] = { FKNAM, FKNAM, FKNAM, FKNAM, FKNAM, FKNAM,
|
|||
/* For diskio.c code */
|
||||
device_partition_t *g_volume_to_devparts[FF_VOLUMES] = { NULL };
|
||||
|
||||
#include <stdio.h>
|
||||
int fsdev_mount_device(const char *name, const device_partition_t *devpart, bool initialize_immediately) {
|
||||
fsdev_fsdevice_t *device = NULL;
|
||||
FRESULT rc;
|
||||
|
|
|
@ -72,7 +72,7 @@ DRESULT disk_read (
|
|||
if (devpart == NULL) {
|
||||
return RES_PARERR;
|
||||
} else if (devpart->reader != NULL) {
|
||||
int rc = devpart->reader(devpart, buff, sector, count);
|
||||
int rc = device_partition_read_data(devpart, buff, sector, count);
|
||||
return rc == 0 ? 0 : RES_ERROR;
|
||||
} else {
|
||||
return RES_ERROR;
|
||||
|
@ -97,7 +97,7 @@ DRESULT disk_write (
|
|||
if (devpart == NULL) {
|
||||
return RES_PARERR;
|
||||
} else if (devpart->writer != NULL) {
|
||||
int rc = devpart->writer(devpart, buff, sector, count);
|
||||
int rc = device_partition_write_data(devpart, buff, sector, count);
|
||||
return rc == 0 ? 0 : RES_ERROR;
|
||||
} else {
|
||||
return RES_ERROR;
|
||||
|
|
|
@ -45,13 +45,13 @@ static int mmc_partition_initialize(device_partition_t *devpart) {
|
|||
int rc = sdmmc_init(mmcpart->mmc, mmcpart->controller);
|
||||
if (rc == 0) {
|
||||
sdmmc_set_write_enable(mmcpart->mmc, SDMMC_WRITE_ENABLED);
|
||||
g_sd_mmc_initialized = true;
|
||||
devpart->initialized = g_sd_mmc_initialized = true;
|
||||
}
|
||||
return rc;
|
||||
} else if (mmcpart->mmc == &g_nand_mmc && !g_nand_mmc_initialized) {
|
||||
int rc = sdmmc_init(mmcpart->mmc, mmcpart->controller);
|
||||
if (rc == 0) {
|
||||
g_nand_mmc_initialized = true;
|
||||
devpart->initialized = g_nand_mmc_initialized = true;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue