bdk: remove sd mounts from ianos and check if sd is mounted in sd ops

This commit is contained in:
CTCaer
2022-02-15 00:17:53 +02:00
parent 73d38e1183
commit ce8d1eca91
2 changed files with 13 additions and 10 deletions

View File

@@ -210,6 +210,9 @@ bool sd_is_gpt()
void *sd_file_read(const char *path, u32 *fsize)
{
FIL fp;
if (!sd_get_card_mounted())
return NULL;
if (f_open(&fp, path, FA_READ) != FR_OK)
return NULL;
@@ -236,6 +239,9 @@ int sd_save_to_file(void *buf, u32 size, const char *filename)
{
FIL fp;
u32 res = 0;
if (!sd_get_card_mounted())
return NULL;
res = f_open(&fp, filename, FA_CREATE_ALWAYS | FA_WRITE);
if (res)
{