[FL-2675] /int space reservation (#1448)
* storage: added global #defines for /int, /ext & /any * storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros * core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction * storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders * core: added macro aliases for core record names * Bumped protobuf commit pointer * storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -95,7 +95,7 @@ SubGhz* subghz_alloc() {
|
||||
string_init(subghz->file_path_tmp);
|
||||
|
||||
// GUI
|
||||
subghz->gui = furi_record_open("gui");
|
||||
subghz->gui = furi_record_open(RECORD_GUI);
|
||||
|
||||
// View Dispatcher
|
||||
subghz->view_dispatcher = view_dispatcher_alloc();
|
||||
@@ -111,7 +111,7 @@ SubGhz* subghz_alloc() {
|
||||
subghz->view_dispatcher, subghz_tick_event_callback, 100);
|
||||
|
||||
// Open Notification record
|
||||
subghz->notifications = furi_record_open("notification");
|
||||
subghz->notifications = furi_record_open(RECORD_NOTIFICATION);
|
||||
|
||||
// SubMenu
|
||||
subghz->submenu = submenu_alloc();
|
||||
@@ -141,7 +141,7 @@ SubGhz* subghz_alloc() {
|
||||
subghz->view_dispatcher, SubGhzViewIdWidget, widget_get_view(subghz->widget));
|
||||
|
||||
//Dialog
|
||||
subghz->dialogs = furi_record_open("dialogs");
|
||||
subghz->dialogs = furi_record_open(RECORD_DIALOGS);
|
||||
|
||||
// Transmitter
|
||||
subghz->subghz_transmitter = subghz_view_transmitter_alloc();
|
||||
@@ -194,7 +194,7 @@ SubGhz* subghz_alloc() {
|
||||
|
||||
//init setting
|
||||
subghz->setting = subghz_setting_alloc();
|
||||
subghz_setting_load(subghz->setting, "/ext/subghz/assets/setting_user");
|
||||
subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user"));
|
||||
|
||||
//init Worker & Protocol & History & KeyBoard
|
||||
subghz->lock = SubGhzLockOff;
|
||||
@@ -210,9 +210,9 @@ SubGhz* subghz_alloc() {
|
||||
|
||||
subghz->txrx->environment = subghz_environment_alloc();
|
||||
subghz_environment_set_came_atomo_rainbow_table_file_name(
|
||||
subghz->txrx->environment, "/ext/subghz/assets/came_atomo");
|
||||
subghz->txrx->environment, EXT_PATH("subghz/assets/came_atomo"));
|
||||
subghz_environment_set_nice_flor_s_rainbow_table_file_name(
|
||||
subghz->txrx->environment, "/ext/subghz/assets/nice_flor_s");
|
||||
subghz->txrx->environment, EXT_PATH("subghz/assets/nice_flor_s"));
|
||||
subghz->txrx->receiver = subghz_receiver_alloc_init(subghz->txrx->environment);
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable);
|
||||
|
||||
@@ -263,7 +263,7 @@ void subghz_free(SubGhz* subghz) {
|
||||
widget_free(subghz->widget);
|
||||
|
||||
//Dialog
|
||||
furi_record_close("dialogs");
|
||||
furi_record_close(RECORD_DIALOGS);
|
||||
|
||||
// Transmitter
|
||||
view_dispatcher_remove_view(subghz->view_dispatcher, SubGhzViewIdTransmitter);
|
||||
@@ -296,7 +296,7 @@ void subghz_free(SubGhz* subghz) {
|
||||
view_dispatcher_free(subghz->view_dispatcher);
|
||||
|
||||
// GUI
|
||||
furi_record_close("gui");
|
||||
furi_record_close(RECORD_GUI);
|
||||
subghz->gui = NULL;
|
||||
|
||||
//setting
|
||||
@@ -314,7 +314,7 @@ void subghz_free(SubGhz* subghz) {
|
||||
string_clear(subghz->error_str);
|
||||
|
||||
// Notifications
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
subghz->notifications = NULL;
|
||||
|
||||
// Path strings
|
||||
@@ -330,9 +330,9 @@ int32_t subghz_app(void* p) {
|
||||
|
||||
//Load database
|
||||
bool load_database = subghz_environment_load_keystore(
|
||||
subghz->txrx->environment, "/ext/subghz/assets/keeloq_mfcodes");
|
||||
subghz->txrx->environment, EXT_PATH("subghz/assets/keeloq_mfcodes"));
|
||||
subghz_environment_load_keystore(
|
||||
subghz->txrx->environment, "/ext/subghz/assets/keeloq_mfcodes_user");
|
||||
subghz->txrx->environment, EXT_PATH("subghz/assets/keeloq_mfcodes_user"));
|
||||
// Check argument and run corresponding scene
|
||||
if(p) {
|
||||
uint32_t rpc_ctx = 0;
|
||||
|
Reference in New Issue
Block a user