use RECORD defines

This commit is contained in:
MX 2022-08-13 17:58:46 +03:00
parent 686786bb2f
commit 4dab3a83a3
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
14 changed files with 48 additions and 48 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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;

View file

@ -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) &&