mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
remove region_data from int
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <stdint.h>
|
||||
#include <toolbox/dir_walk.h>
|
||||
#include <toolbox/path.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
#define TAG "MoveToSd"
|
||||
|
||||
@@ -20,6 +21,17 @@ static bool storage_move_to_sd_check_entry(const char* name, FileInfo* fileinfo,
|
||||
return (name && (*name != '.'));
|
||||
}
|
||||
|
||||
static void storage_move_to_sd_remove_region() {
|
||||
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) return;
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
if(storage_common_exists(storage, INT_PATH(".region_data"))) {
|
||||
storage_common_remove(storage, INT_PATH(".region_data"));
|
||||
}
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
}
|
||||
|
||||
bool storage_move_to_sd_perform(void) {
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
@@ -162,6 +174,9 @@ int32_t storage_move_to_sd_app(void* p) {
|
||||
FURI_LOG_I(TAG, "Nothing to move");
|
||||
}
|
||||
|
||||
// Remove unused region file from int memory
|
||||
storage_move_to_sd_remove_region();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user