move boot_storage.h/.c to bdk/storage, check result of ensure_partition

This commit is contained in:
Christoph Baumann
2025-04-22 14:25:14 +02:00
parent fe5e4dc40a
commit 4e9e21b3b1
6 changed files with 11 additions and 5 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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"