move boot_storage.h/.c to bdk/storage, check result of ensure_partition
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include "../frontend/fe_tools.h"
|
||||
#include "../config.h"
|
||||
#include "../storage/emummc.h"
|
||||
#include "../storage/boot_storage.h"
|
||||
#include <storage/boot_storage.h>
|
||||
|
||||
extern hekate_config h_cfg;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../hos/pkg1.h"
|
||||
#include "l4t.h"
|
||||
#include "l4t_config.inl"
|
||||
#include "../storage/boot_storage.h"
|
||||
#include <storage/boot_storage.h>
|
||||
|
||||
/*
|
||||
* API Revision info
|
||||
|
||||
@@ -69,6 +69,10 @@ DRESULT disk_read (
|
||||
UINT count /* Number of sectors to read */
|
||||
)
|
||||
{
|
||||
if(!ensure_partition(pdrv)){
|
||||
return RES_ERROR;
|
||||
}
|
||||
|
||||
sdmmc_storage_t *storage = &sd_storage;
|
||||
u32 actual_sector = sector;
|
||||
switch(pdrv){
|
||||
@@ -87,7 +91,6 @@ DRESULT disk_read (
|
||||
|
||||
}
|
||||
|
||||
ensure_partition(pdrv);
|
||||
|
||||
return sdmmc_storage_read(storage, actual_sector, count, buff) ? RES_OK : RES_ERROR;
|
||||
}
|
||||
@@ -102,6 +105,10 @@ DRESULT disk_write (
|
||||
UINT count /* Number of sectors to write */
|
||||
)
|
||||
{
|
||||
if(!ensure_partition(pdrv)){
|
||||
return RES_ERROR;
|
||||
}
|
||||
|
||||
sdmmc_storage_t *storage = &sd_storage;
|
||||
u32 actual_sector = sector;
|
||||
switch(pdrv){
|
||||
@@ -120,7 +127,6 @@ DRESULT disk_write (
|
||||
|
||||
}
|
||||
|
||||
ensure_partition(pdrv);
|
||||
|
||||
return sdmmc_storage_write(storage, actual_sector, count, (void*)buff) ? RES_OK : RES_ERROR;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <libs/compr/blz.h>
|
||||
#include <libs/fatfs/ff.h>
|
||||
#include "storage/emummc.h"
|
||||
#include "storage/boot_storage.h"
|
||||
#include <storage/boot_storage.h>
|
||||
|
||||
#include "frontend/fe_tools.h"
|
||||
#include "frontend/fe_info.h"
|
||||
|
||||
Reference in New Issue
Block a user