diff options
author | gornekich <n.gorbadey@gmail.com> | 2022-02-02 18:58:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 18:58:52 +0300 |
commit | 838df4c9ea67d390e609d7919cbdc1ca0bb26412 (patch) | |
tree | 94b2523d641d3d92326ad7fcc11ce656a43599d8 /applications/subghz | |
parent | d2c4f15af5f79756343df95640fad404ee1af6f8 (diff) |
[FL-2229] New assets paths (#978)
* assets: change resources paths
* apps: rework nfc, irda and subghz with new assets path
* subghz: remove unused paths
* subghz: fix incorrect path
* badusb and u2f fix
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
Diffstat (limited to 'applications/subghz')
-rw-r--r-- | applications/subghz/scenes/subghz_scene_read_raw.c | 2 | ||||
-rw-r--r-- | applications/subghz/scenes/subghz_scene_save_name.c | 2 | ||||
-rw-r--r-- | applications/subghz/subghz.c | 8 | ||||
-rw-r--r-- | applications/subghz/subghz_cli.c | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | applications/subghz/subghz_i.c | 20 |
5 files changed, 17 insertions, 23 deletions
diff --git a/applications/subghz/scenes/subghz_scene_read_raw.c b/applications/subghz/scenes/subghz_scene_read_raw.c index 481138dc..170d3c7d 100644 --- a/applications/subghz/scenes/subghz_scene_read_raw.c +++ b/applications/subghz/scenes/subghz_scene_read_raw.c @@ -23,7 +23,7 @@ bool subghz_scene_read_raw_update_filename(SubGhz* subghz) { path_extract_filename_no_ext(string_get_cstr(temp_str), temp_str); strcpy(subghz->file_name, string_get_cstr(temp_str)); string_printf( - temp_str, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); + temp_str, "%s/%s%s", SUBGHZ_APP_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); subghz_protocol_raw_set_last_file_name( (SubGhzProtocolRAW*)subghz->txrx->protocol_result, string_get_cstr(temp_str)); diff --git a/applications/subghz/scenes/subghz_scene_save_name.c b/applications/subghz/scenes/subghz_scene_save_name.c index 142ba7c9..ee1df00f 100644 --- a/applications/subghz/scenes/subghz_scene_save_name.c +++ b/applications/subghz/scenes/subghz_scene_save_name.c @@ -39,7 +39,7 @@ void subghz_scene_save_name_on_enter(void* context) { dev_name_empty); ValidatorIsFile* validator_is_file = - validator_is_file_alloc_init(SUBGHZ_APP_PATH_FOLDER, SUBGHZ_APP_EXTENSION); + validator_is_file_alloc_init(SUBGHZ_APP_FOLDER, SUBGHZ_APP_EXTENSION); text_input_set_validator(text_input, validator_is_file_callback, validator_is_file); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTextInput); diff --git a/applications/subghz/subghz.c b/applications/subghz/subghz.c index f13c86d6..4f442562 100644 --- a/applications/subghz/subghz.c +++ b/applications/subghz/subghz.c @@ -284,10 +284,10 @@ int32_t subghz_app(void* p) { //Load database bool load_database = - subghz_parser_load_keeloq_file(subghz->txrx->parser, "/ext/subghz/keeloq_mfcodes"); - subghz_parser_load_keeloq_file(subghz->txrx->parser, "/ext/subghz/keeloq_mfcodes_user"); - subghz_parser_load_nice_flor_s_file(subghz->txrx->parser, "/ext/subghz/nice_flor_s_rx"); - subghz_parser_load_came_atomo_file(subghz->txrx->parser, "/ext/subghz/came_atomo"); + subghz_parser_load_keeloq_file(subghz->txrx->parser, "/ext/subghz/assets/keeloq_mfcodes"); + subghz_parser_load_keeloq_file(subghz->txrx->parser, "/ext/subghz/assets/keeloq_mfcodes_user"); + subghz_parser_load_nice_flor_s_file(subghz->txrx->parser, "/ext/subghz/assets/nice_flor_s_rx"); + subghz_parser_load_came_atomo_file(subghz->txrx->parser, "/ext/subghz/assets/came_atomo"); // Check argument and run corresponding scene if(p && subghz_key_load(subghz, p)) { diff --git a/applications/subghz/subghz_cli.c b/applications/subghz/subghz_cli.c index b91b9a4b..c54533d9 100644 --- a/applications/subghz/subghz_cli.c +++ b/applications/subghz/subghz_cli.c @@ -215,10 +215,10 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { furi_check(instance->stream); SubGhzParser* parser = subghz_parser_alloc(); - subghz_parser_load_keeloq_file(parser, "/ext/subghz/keeloq_mfcodes"); - subghz_parser_load_keeloq_file(parser, "/ext/subghz/keeloq_mfcodes_user"); - subghz_parser_load_nice_flor_s_file(parser, "/ext/subghz/nice_flor_s_rx"); - subghz_parser_load_came_atomo_file(parser, "/ext/subghz/came_atomo"); + subghz_parser_load_keeloq_file(parser, "/ext/subghz/assets/keeloq_mfcodes"); + subghz_parser_load_keeloq_file(parser, "/ext/subghz/assets/keeloq_mfcodes_user"); + subghz_parser_load_nice_flor_s_file(parser, "/ext/subghz/assets/nice_flor_s_rx"); + subghz_parser_load_came_atomo_file(parser, "/ext/subghz/assets/came_atomo"); subghz_parser_enable_dump_text(parser, subghz_cli_command_rx_text_callback, instance); // Configure radio diff --git a/applications/subghz/subghz_i.c b/applications/subghz/subghz_i.c index 5a1f67fe..87537ca2 100644..100755 --- a/applications/subghz/subghz_i.c +++ b/applications/subghz/subghz_i.c @@ -284,7 +284,7 @@ bool subghz_get_next_name_file(SubGhz* subghz) { if(strcmp(subghz->file_name, "")) { //get the name of the next free file storage_get_next_filename( - storage, SUBGHZ_RAW_PATH_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION, temp_str); + storage, SUBGHZ_RAW_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION, temp_str); strcpy(subghz->file_name, string_get_cstr(temp_str)); res = true; @@ -319,15 +319,9 @@ bool subghz_save_protocol_to_file(SubGhz* subghz, const char* dev_name) { dialog_message_show_storage_error(subghz->dialogs, "Cannot create\nfolder"); break; } - // Create saved directory if necessary - if(!storage_simply_mkdir(storage, SUBGHZ_APP_PATH_FOLDER)) { - dialog_message_show_storage_error(subghz->dialogs, "Cannot create\nfolder"); - break; - } // First remove subghz device file if it was saved - string_printf( - dev_file_name, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, dev_name, SUBGHZ_APP_EXTENSION); + string_printf(dev_file_name, "%s/%s%s", SUBGHZ_APP_FOLDER, dev_name, SUBGHZ_APP_EXTENSION); if(!storage_simply_remove(storage, string_get_cstr(dev_file_name))) { break; @@ -386,7 +380,7 @@ bool subghz_load_protocol_from_file(SubGhz* subghz) { // Input events and views are managed by file_select bool res = dialog_file_select_show( subghz->dialogs, - SUBGHZ_APP_PATH_FOLDER, + SUBGHZ_APP_FOLDER, SUBGHZ_APP_EXTENSION, subghz->file_name, sizeof(subghz->file_name), @@ -394,7 +388,7 @@ bool subghz_load_protocol_from_file(SubGhz* subghz) { if(res) { string_printf( - file_name, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); + file_name, "%s/%s%s", SUBGHZ_APP_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); res = subghz_key_load(subghz, string_get_cstr(file_name)); } @@ -413,10 +407,10 @@ bool subghz_rename_file(SubGhz* subghz) { Storage* storage = furi_record_open("storage"); string_init_printf( - old_path, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, subghz->file_name_tmp, SUBGHZ_APP_EXTENSION); + old_path, "%s/%s%s", SUBGHZ_APP_FOLDER, subghz->file_name_tmp, SUBGHZ_APP_EXTENSION); string_init_printf( - new_path, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); + new_path, "%s/%s%s", SUBGHZ_APP_FOLDER, subghz->file_name, SUBGHZ_APP_EXTENSION); FS_Error fs_result = storage_common_rename(storage, string_get_cstr(old_path), string_get_cstr(new_path)); @@ -439,7 +433,7 @@ bool subghz_delete_file(SubGhz* subghz) { Storage* storage = furi_record_open("storage"); string_t file_path; string_init_printf( - file_path, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, subghz->file_name_tmp, SUBGHZ_APP_EXTENSION); + file_path, "%s/%s%s", SUBGHZ_APP_FOLDER, subghz->file_name_tmp, SUBGHZ_APP_EXTENSION); bool result = storage_simply_remove(storage, string_get_cstr(file_path)); furi_record_close("storage"); |