From 4dab3a83a37168dafdba02ed8432cabfb2142681 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 13 Aug 2022 17:58:46 +0300 Subject: [PATCH] use RECORD defines --- .../barcode_generator/barcode_generator.c | 4 +-- applications/clock_app/clock_app.c | 4 +-- .../dec_hex_converter/dec_hex_converter.c | 4 +-- applications/esp8266_deauth/esp8266_deauth.c | 4 +-- applications/mousejacker/mousejacker.c | 8 ++--- applications/sentry_safe/sentry_safe.c | 4 +-- .../spectrum_analyzer/spectrum_analyzer.c | 4 +-- applications/tetris_game/tetris_game.c | 4 +-- applications/tictactoe_game/tictactoe_game.c | 4 +-- applications/unirfremix/unirfremix_app.c | 32 +++++++++---------- applications/wav_player/wav_player.c | 12 +++---- .../wifi_marauder_app.c | 4 +-- applications/wifi_scanner/wifi_scanner.c | 4 +-- .../targets/f7/furi_hal/furi_hal_subghz.c | 4 +-- 14 files changed, 48 insertions(+), 48 deletions(-) diff --git a/applications/barcode_generator/barcode_generator.c b/applications/barcode_generator/barcode_generator.c index 59d5d6ddf..d03d45495 100644 --- a/applications/barcode_generator/barcode_generator.c +++ b/applications/barcode_generator/barcode_generator.c @@ -423,7 +423,7 @@ int32_t barcode_UPCA_generator_app(void* p) { view_port_input_callback_set(view_port, input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); PluginEvent event; @@ -537,7 +537,7 @@ int32_t barcode_UPCA_generator_app(void* p) { view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); diff --git a/applications/clock_app/clock_app.c b/applications/clock_app/clock_app.c index 2931fac72..3614b8429 100644 --- a/applications/clock_app/clock_app.c +++ b/applications/clock_app/clock_app.c @@ -96,7 +96,7 @@ int32_t clock_app(void* p) { furi_timer_start(timer, furi_kernel_get_tick_frequency()); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); // Main loop @@ -137,7 +137,7 @@ int32_t clock_app(void* p) { furi_timer_free(timer); view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); delete_mutex(&state_mutex); diff --git a/applications/dec_hex_converter/dec_hex_converter.c b/applications/dec_hex_converter/dec_hex_converter.c index 1661dbd16..98a090a82 100644 --- a/applications/dec_hex_converter/dec_hex_converter.c +++ b/applications/dec_hex_converter/dec_hex_converter.c @@ -333,7 +333,7 @@ int32_t dec_hex_converter_app(void* p) { view_port_input_callback_set(view_port, dec_hex_converter_input_callback, event_queue); // open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); dec_hex_converter_init(dec_hex_converter_state); @@ -394,7 +394,7 @@ int32_t dec_hex_converter_app(void* p) { view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); delete_mutex(&state_mutex); diff --git a/applications/esp8266_deauth/esp8266_deauth.c b/applications/esp8266_deauth/esp8266_deauth.c index 10bcd2af9..253ad650f 100644 --- a/applications/esp8266_deauth/esp8266_deauth.c +++ b/applications/esp8266_deauth/esp8266_deauth.c @@ -377,7 +377,7 @@ int32_t esp8266_deauth_app(void* p) { view_port_input_callback_set(view_port, esp8266_deauth_module_input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); //notification_message(app->notification, &sequence_set_only_blue_255); @@ -511,7 +511,7 @@ int32_t esp8266_deauth_app(void* p) { gui_remove_view_port(gui, view_port); // Close gui record - furi_record_close("gui"); + furi_record_close(RECORD_GUI); furi_record_close("notification"); app->m_gui = NULL; diff --git a/applications/mousejacker/mousejacker.c b/applications/mousejacker/mousejacker.c index 4e0094ab0..d651496f7 100644 --- a/applications/mousejacker/mousejacker.c +++ b/applications/mousejacker/mousejacker.c @@ -240,10 +240,10 @@ int32_t mousejacker_app(void* p) { view_port_input_callback_set(view_port, input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); storage_common_mkdir(storage, MOUSEJACKER_APP_PATH_FOLDER); Stream* file_stream = file_stream_alloc(storage); @@ -329,8 +329,8 @@ int32_t mousejacker_app(void* p) { furi_hal_spi_release(nrf24_HANDLE); view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); - furi_record_close("storage"); + furi_record_close(RECORD_GUI); + furi_record_close(RECORD_STORAGE); view_port_free(view_port); furi_message_queue_free(event_queue); diff --git a/applications/sentry_safe/sentry_safe.c b/applications/sentry_safe/sentry_safe.c index 328b53f03..d36e4a63a 100644 --- a/applications/sentry_safe/sentry_safe.c +++ b/applications/sentry_safe/sentry_safe.c @@ -102,7 +102,7 @@ int32_t sentry_safe_app(void* p) { view_port_input_callback_set(view_port, sentry_safe_input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); Event event; @@ -156,7 +156,7 @@ int32_t sentry_safe_app(void* p) { view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); delete_mutex(&state_mutex); diff --git a/applications/spectrum_analyzer/spectrum_analyzer.c b/applications/spectrum_analyzer/spectrum_analyzer.c index e7047763f..503870ed8 100644 --- a/applications/spectrum_analyzer/spectrum_analyzer.c +++ b/applications/spectrum_analyzer/spectrum_analyzer.c @@ -369,7 +369,7 @@ SpectrumAnalyzer* spectrum_analyzer_alloc() { view_port_input_callback_set(instance->view_port, spectrum_analyzer_input_callback, instance); // Open GUI and register view_port - instance->gui = furi_record_open("gui"); + instance->gui = furi_record_open(RECORD_GUI); gui_add_view_port(instance->gui, instance->view_port, GuiLayerFullscreen); return instance; @@ -378,7 +378,7 @@ SpectrumAnalyzer* spectrum_analyzer_alloc() { void spectrum_analyzer_free(SpectrumAnalyzer* instance) { // view_port_enabled_set(view_port, false); gui_remove_view_port(instance->gui, instance->view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(instance->view_port); spectrum_analyzer_worker_free(instance->worker); diff --git a/applications/tetris_game/tetris_game.c b/applications/tetris_game/tetris_game.c index 678c9de31..29b61cd2a 100644 --- a/applications/tetris_game/tetris_game.c +++ b/applications/tetris_game/tetris_game.c @@ -373,7 +373,7 @@ int32_t tetris_game_app() { view_port_input_callback_set(view_port, tetris_game_input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); tetris_state->timer = @@ -460,7 +460,7 @@ int32_t tetris_game_app() { furi_timer_free(tetris_state->timer); view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); delete_mutex(&state_mutex); diff --git a/applications/tictactoe_game/tictactoe_game.c b/applications/tictactoe_game/tictactoe_game.c index 769eaeb38..b3a0d5c84 100644 --- a/applications/tictactoe_game/tictactoe_game.c +++ b/applications/tictactoe_game/tictactoe_game.c @@ -327,7 +327,7 @@ int32_t tictactoe_game_app(void* p) { tictactoe_state_init(tictactoe_state); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); GameEvent event; @@ -373,7 +373,7 @@ int32_t tictactoe_game_app(void* p) { furi_timer_free(tictactoe_state->timer); view_port_enabled_set(view_port, false); gui_remove_view_port(gui, view_port); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); view_port_free(view_port); furi_message_queue_free(event_queue); delete_mutex(&state_mutex); diff --git a/applications/unirfremix/unirfremix_app.c b/applications/unirfremix/unirfremix_app.c index 000b20ef1..b943b44a1 100644 --- a/applications/unirfremix/unirfremix_app.c +++ b/applications/unirfremix/unirfremix_app.c @@ -154,7 +154,7 @@ static char* extract_filename(const char* name, int len) { */ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); app->file_result = 3; @@ -350,7 +350,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); //File Existence Check //Check each file definition if not already set to "N/A" @@ -372,7 +372,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { //if button is still enabled, check that file exists if(app->up_enabled == 1) { string_set(file_name, app->up_file); - storage = furi_record_open("storage"); + storage = furi_record_open(RECORD_STORAGE); fff_data_file = flipper_format_file_alloc(storage); if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { @@ -386,12 +386,12 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { //close the file flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); } if(app->down_enabled == 1) { string_set(file_name, app->down_file); - storage = furi_record_open("storage"); + storage = furi_record_open(RECORD_STORAGE); fff_data_file = flipper_format_file_alloc(storage); if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { @@ -403,12 +403,12 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); } if(app->left_enabled == 1) { string_set(file_name, app->left_file); - storage = furi_record_open("storage"); + storage = furi_record_open(RECORD_STORAGE); fff_data_file = flipper_format_file_alloc(storage); if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { @@ -420,12 +420,12 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); } if(app->right_enabled == 1) { string_set(file_name, app->right_file); - storage = furi_record_open("storage"); + storage = furi_record_open(RECORD_STORAGE); fff_data_file = flipper_format_file_alloc(storage); if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { @@ -437,12 +437,12 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); } if(app->ok_enabled == 1) { string_set(file_name, app->ok_file); - storage = furi_record_open("storage"); + storage = furi_record_open(RECORD_STORAGE); fff_data_file = flipper_format_file_alloc(storage); if(!flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name))) { @@ -454,7 +454,7 @@ void unirfremix_cfg_set_check(UniRFRemix* app, string_t file_name) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); } if(app->file_blank == 5) { @@ -555,7 +555,7 @@ static void unirfremix_process_signal(UniRFRemix* app, string_t signal) { string_set(file_name, string_get_cstr(signal)); - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); flipper_format_file_open_existing(fff_data_file, string_get_cstr(file_name)); @@ -568,7 +568,7 @@ static void unirfremix_process_signal(UniRFRemix* app, string_t signal) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); FURI_LOG_I(TAG, "%lu", frequency_str); @@ -747,11 +747,11 @@ int32_t unirfremix_app(void* p) { app->file_result = 3; - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); if(!storage_simply_mkdir(storage, UNIRFMAP_FOLDER)) { FURI_LOG_E(TAG, "Could not create folder %s", UNIRFMAP_FOLDER); } - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); string_set_str(app->file_path, UNIRFMAP_FOLDER); diff --git a/applications/wav_player/wav_player.c b/applications/wav_player/wav_player.c index dc8069fb0..2f9c58cd7 100644 --- a/applications/wav_player/wav_player.c +++ b/applications/wav_player/wav_player.c @@ -96,7 +96,7 @@ static WavPlayerApp* app_alloc() { WavPlayerApp* app = malloc(sizeof(WavPlayerApp)); app->samples_count_half = 1024 * 4; app->samples_count = app->samples_count_half * 2; - app->storage = furi_record_open("storage"); + app->storage = furi_record_open(RECORD_STORAGE); app->stream = file_stream_alloc(app->storage); app->parser = wav_parser_alloc(); app->sample_buffer = malloc(sizeof(uint16_t) * app->samples_count); @@ -106,7 +106,7 @@ static WavPlayerApp* app_alloc() { app->volume = 10.0f; app->play = true; - app->gui = furi_record_open("gui"); + app->gui = furi_record_open(RECORD_GUI); app->view_dispatcher = view_dispatcher_alloc(); app->view = wav_player_view_alloc(); @@ -124,14 +124,14 @@ static void app_free(WavPlayerApp* app) { view_dispatcher_remove_view(app->view_dispatcher, 0); view_dispatcher_free(app->view_dispatcher); wav_player_view_free(app->view); - furi_record_close("gui"); + furi_record_close(RECORD_GUI); furi_message_queue_free(app->queue); free(app->tmp_buffer); free(app->sample_buffer); wav_parser_free(app->parser); stream_free(app->stream); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); notification_message(app->notification, &sequence_display_backlight_enforce_auto); furi_record_close("notification"); @@ -296,11 +296,11 @@ int32_t wav_player_app(void* p) { UNUSED(p); WavPlayerApp* app = app_alloc(); - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); if(!storage_simply_mkdir(storage, WAVPLAYER_FOLDER)) { FURI_LOG_E(TAG, "Could not create folder %s", WAVPLAYER_FOLDER); } - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); app_run(app); app_free(app); diff --git a/applications/wifi_marauder_companion/wifi_marauder_app.c b/applications/wifi_marauder_companion/wifi_marauder_app.c index 76a802d8a..b145e56c0 100644 --- a/applications/wifi_marauder_companion/wifi_marauder_app.c +++ b/applications/wifi_marauder_companion/wifi_marauder_app.c @@ -24,7 +24,7 @@ static void wifi_marauder_app_tick_event_callback(void* context) { WifiMarauderApp* wifi_marauder_app_alloc() { WifiMarauderApp* app = malloc(sizeof(WifiMarauderApp)); - app->gui = furi_record_open("gui"); + app->gui = furi_record_open(RECORD_GUI); app->view_dispatcher = view_dispatcher_alloc(); app->scene_manager = scene_manager_alloc(&wifi_marauder_scene_handlers, app); @@ -79,7 +79,7 @@ void wifi_marauder_app_free(WifiMarauderApp* app) { wifi_marauder_uart_free(app->uart); // Close records - furi_record_close("gui"); + furi_record_close(RECORD_GUI); free(app); } diff --git a/applications/wifi_scanner/wifi_scanner.c b/applications/wifi_scanner/wifi_scanner.c index 8421c9ea4..118bc5005 100644 --- a/applications/wifi_scanner/wifi_scanner.c +++ b/applications/wifi_scanner/wifi_scanner.c @@ -685,7 +685,7 @@ int32_t wifi_scanner_app(void* p) { view_port_input_callback_set(view_port, wifi_module_input_callback, event_queue); // Open GUI and register view_port - Gui* gui = furi_record_open("gui"); + Gui* gui = furi_record_open(RECORD_GUI); gui_add_view_port(gui, view_port, GuiLayerFullscreen); //notification_message(app->notification, &sequence_set_only_blue_255); @@ -831,7 +831,7 @@ int32_t wifi_scanner_app(void* p) { gui_remove_view_port(gui, view_port); // Close gui record - furi_record_close("gui"); + furi_record_close(RECORD_GUI); furi_record_close("notification"); app->m_gui = NULL; diff --git a/firmware/targets/f7/furi_hal/furi_hal_subghz.c b/firmware/targets/f7/furi_hal/furi_hal_subghz.c index 0e2810141..9db44933d 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_subghz.c +++ b/firmware/targets/f7/furi_hal/furi_hal_subghz.c @@ -320,7 +320,7 @@ bool furi_hal_subghz_is_tx_allowed(uint32_t value) { bool is_extended = false; // TODO: !!! Move file check to another place - Storage* storage = furi_record_open("storage"); + Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(fff_data_file, "/ext/subghz/assets/dangerous_settings")) { @@ -329,7 +329,7 @@ bool furi_hal_subghz_is_tx_allowed(uint32_t value) { } flipper_format_free(fff_data_file); - furi_record_close("storage"); + furi_record_close(RECORD_STORAGE); if(!(value >= 299999755 && value <= 348000335) && !(value >= 386999938 && value <= 464000000) &&