mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-01-19 01:34:10 +01:00
Move fatfs around
This commit is contained in:
parent
0d344e45af
commit
e5fff14689
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "diskio.h" /* FatFs lower layer API */
|
#include "diskio.h" /* FatFs lower layer API */
|
||||||
#include "sdmmc.h"
|
#include "../../sdmmc.h"
|
||||||
|
|
||||||
/* Global sd struct. */
|
/* Global sd struct. */
|
||||||
extern struct mmc sd_mmc;
|
extern struct mmc sd_mmc;
|
@ -2237,7 +2237,7 @@ void init_alloc_info (
|
|||||||
/* exFAT: Load the object's directory entry block */
|
/* exFAT: Load the object's directory entry block */
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
static
|
static
|
||||||
FRESULT load_obj_xdir (
|
FRESULT load_obj_xdir (
|
||||||
DIR* dp, /* Blank directory object to be used to access containing direcotry */
|
DIR* dp, /* Blank directory object to be used to access containing direcotry */
|
||||||
const FFOBJID* obj /* Object with its containing directory information */
|
const FFOBJID* obj /* Object with its containing directory information */
|
||||||
)
|
)
|
@ -2,7 +2,7 @@
|
|||||||
#include "hwinit.h"
|
#include "hwinit.h"
|
||||||
#include "sdmmc.h"
|
#include "sdmmc.h"
|
||||||
#include "lib/printk.h"
|
#include "lib/printk.h"
|
||||||
#include "ff.h"
|
#include "lib/fatfs/ff.h"
|
||||||
|
|
||||||
/* This is used by diskio.h. */
|
/* This is used by diskio.h. */
|
||||||
struct mmc sd_mmc;
|
struct mmc sd_mmc;
|
||||||
@ -51,15 +51,15 @@ size_t read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
|||||||
if (!mounted_sd && mount_sd() == 0) {
|
if (!mounted_sd && mount_sd() == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FIL f;
|
FIL f;
|
||||||
if (f_open(&f, filename, FA_READ) != FR_OK) {
|
if (f_open(&f, filename, FA_READ) != FR_OK) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT br;
|
UINT br;
|
||||||
int res = f_read(&f, dst, dst_size, &br);
|
int res = f_read(&f, dst, dst_size, &br);
|
||||||
f_close(&f);
|
f_close(&f);
|
||||||
|
|
||||||
return res == FR_OK ? (int)br : 0;
|
return res == FR_OK ? (int)br : 0;
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "sdmmc.h"
|
#include "sdmmc.h"
|
||||||
#include "ff.h"
|
#include "lib/fatfs/ff.h"
|
||||||
|
|
||||||
void save_sd_state(void **mmc, void **ff);
|
void save_sd_state(void **mmc, void **ff);
|
||||||
void resume_sd_state(void *mmc, void *ff);
|
void resume_sd_state(void *mmc, void *ff);
|
||||||
|
|
||||||
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "diskio.h" /* FatFs lower layer API */
|
#include "diskio.h" /* FatFs lower layer API */
|
||||||
#include "sdmmc.h"
|
#include "../../sdmmc.h"
|
||||||
|
|
||||||
/* Global sd struct. */
|
/* Global sd struct. */
|
||||||
extern struct mmc sd_mmc;
|
extern struct mmc sd_mmc;
|
@ -2237,7 +2237,7 @@ void init_alloc_info (
|
|||||||
/* exFAT: Load the object's directory entry block */
|
/* exFAT: Load the object's directory entry block */
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
static
|
static
|
||||||
FRESULT load_obj_xdir (
|
FRESULT load_obj_xdir (
|
||||||
DIR* dp, /* Blank directory object to be used to access containing direcotry */
|
DIR* dp, /* Blank directory object to be used to access containing direcotry */
|
||||||
const FFOBJID* obj /* Object with its containing directory information */
|
const FFOBJID* obj /* Object with its containing directory information */
|
||||||
)
|
)
|
@ -2,7 +2,7 @@
|
|||||||
#include "hwinit.h"
|
#include "hwinit.h"
|
||||||
#include "sdmmc.h"
|
#include "sdmmc.h"
|
||||||
#include "lib/printk.h"
|
#include "lib/printk.h"
|
||||||
#include "ff.h"
|
#include "lib/fatfs/ff.h"
|
||||||
|
|
||||||
/* This is used by diskio.h. */
|
/* This is used by diskio.h. */
|
||||||
struct mmc sd_mmc;
|
struct mmc sd_mmc;
|
||||||
@ -51,15 +51,15 @@ size_t read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
|||||||
if (!mounted_sd && mount_sd() == 0) {
|
if (!mounted_sd && mount_sd() == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FIL f;
|
FIL f;
|
||||||
if (f_open(&f, filename, FA_READ) != FR_OK) {
|
if (f_open(&f, filename, FA_READ) != FR_OK) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT br;
|
UINT br;
|
||||||
int res = f_read(&f, dst, dst_size, &br);
|
int res = f_read(&f, dst, dst_size, &br);
|
||||||
f_close(&f);
|
f_close(&f);
|
||||||
|
|
||||||
return res == FR_OK ? (int)br : 0;
|
return res == FR_OK ? (int)br : 0;
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "sdmmc.h"
|
#include "sdmmc.h"
|
||||||
#include "ff.h"
|
#include "lib/fatfs/ff.h"
|
||||||
|
|
||||||
void save_sd_state(void **mmc, void **ff);
|
void save_sd_state(void **mmc, void **ff);
|
||||||
void resume_sd_state(void *mmc, void *ff);
|
void resume_sd_state(void *mmc, void *ff);
|
||||||
|
|
||||||
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user