diff --git a/applications/main/subghz/scenes/subghz_scene_need_saving.c b/applications/main/subghz/scenes/subghz_scene_need_saving.c index 6f04be669..2cfe060c7 100644 --- a/applications/main/subghz/scenes/subghz_scene_need_saving.c +++ b/applications/main/subghz/scenes/subghz_scene_need_saving.c @@ -48,12 +48,7 @@ bool subghz_scene_need_saving_on_event(void* context, SceneManagerEvent event) { } else if(event.event == SubGhzCustomEventSceneExit) { if(subghz->txrx->rx_key_state == SubGhzRxKeyStateExit) { subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE; - subghz_preset_init( - subghz, - subghz_setting_get_preset_name(subghz->setting, subghz->last_settings->preset), - subghz->last_settings->frequency, - NULL, - 0); + subghz_preset_init(subghz, "AM650", subghz->last_settings->frequency, NULL, 0); scene_manager_search_and_switch_to_previous_scene( subghz->scene_manager, SubGhzSceneStart); } else { diff --git a/applications/main/subghz/scenes/subghz_scene_read_raw.c b/applications/main/subghz/scenes/subghz_scene_read_raw.c index 4fa0ca7b4..1574225fd 100644 --- a/applications/main/subghz/scenes/subghz_scene_read_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_read_raw.c @@ -161,13 +161,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) { NULL, 0); } else { - subghz_preset_init( - subghz, - subghz_setting_get_preset_name( - subghz->setting, subghz->last_settings->preset), - subghz->last_settings->frequency, - NULL, - 0); + subghz_preset_init(subghz, "AM650", subghz->last_settings->frequency, NULL, 0); } if(!scene_manager_search_and_switch_to_previous_scene( subghz->scene_manager, SubGhzSceneSaved)) { diff --git a/applications/main/subghz/scenes/subghz_scene_receiver.c b/applications/main/subghz/scenes/subghz_scene_receiver.c index 87a7c9552..0719f38e3 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver.c @@ -116,12 +116,7 @@ void subghz_scene_receiver_on_enter(void* context) { str_buff = furi_string_alloc(); if(subghz->txrx->rx_key_state == SubGhzRxKeyStateIDLE) { - subghz_preset_init( - subghz, - subghz_setting_get_preset_name(subghz->setting, subghz->last_settings->preset), - subghz->last_settings->frequency, - NULL, - 0); + subghz_preset_init(subghz, "AM650", subghz->last_settings->frequency, NULL, 0); subghz_history_reset(subghz->txrx->history); subghz->txrx->rx_key_state = SubGhzRxKeyStateStart; } @@ -186,12 +181,7 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) { scene_manager_next_scene(subghz->scene_manager, SubGhzSceneNeedSaving); } else { subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE; - subghz_preset_init( - subghz, - subghz_setting_get_preset_name(subghz->setting, subghz->last_settings->preset), - subghz->last_settings->frequency, - NULL, - 0); + subghz_preset_init(subghz, "AM650", subghz->last_settings->frequency, NULL, 0); scene_manager_search_and_switch_to_previous_scene( subghz->scene_manager, SubGhzSceneStart); } diff --git a/applications/main/subghz/scenes/subghz_scene_receiver_config.c b/applications/main/subghz/scenes/subghz_scene_receiver_config.c index 4b88374d6..294cc1bc0 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver_config.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver_config.c @@ -195,7 +195,7 @@ static void subghz_scene_receiver_config_set_preset(VariableItem* item) { uint8_t index = variable_item_get_current_value_index(item); const char* preset_name = subghz_setting_get_preset_name(subghz->setting, index); variable_item_set_current_value_text(item, preset_name); - subghz->last_settings->preset = index; + //subghz->last_settings->preset = index; subghz_preset_init( subghz, diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index 5d0d84b70..c6614f0cf 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -191,8 +191,7 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { // Load last used values for Read, Read RAW, etc. or default if(!alloc_for_tx_only) { subghz->last_settings = subghz_last_settings_alloc(); - subghz_last_settings_load( - subghz->last_settings, subghz_setting_get_preset_count(subghz->setting)); + subghz_last_settings_load(subghz->last_settings, 0); #if FURI_DEBUG #ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING FURI_LOG_D( @@ -217,12 +216,7 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { subghz->txrx->preset = malloc(sizeof(SubGhzRadioPreset)); subghz->txrx->preset->name = furi_string_alloc(); if(!alloc_for_tx_only) { - subghz_preset_init( - subghz, - subghz_setting_get_preset_name(subghz->setting, subghz->last_settings->preset), - subghz->last_settings->frequency, - NULL, - 0); + subghz_preset_init(subghz, "AM650", subghz->last_settings->frequency, NULL, 0); } else { subghz_preset_init( subghz, "AM650", subghz_setting_get_default_frequency(subghz->setting), NULL, 0); diff --git a/applications/main/subghz/subghz_last_settings.c b/applications/main/subghz/subghz_last_settings.c index bf3638908..8b925198b 100644 --- a/applications/main/subghz/subghz_last_settings.c +++ b/applications/main/subghz/subghz_last_settings.c @@ -21,7 +21,7 @@ #endif #define SUBGHZ_LAST_SETTING_FIELD_FREQUENCY "Frequency" -#define SUBGHZ_LAST_SETTING_FIELD_PRESET "Preset" +//#define SUBGHZ_LAST_SETTING_FIELD_PRESET "Preset" #define SUBGHZ_LAST_SETTING_FIELD_FREQUENCY_ANALYZER_FEEDBACK_LEVEL "FeedbackLevel" SubGhzLastSettings* subghz_last_settings_alloc(void) { @@ -35,6 +35,7 @@ void subghz_last_settings_free(SubGhzLastSettings* instance) { } void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count) { + UNUSED(preset_count); furi_assert(instance); #ifdef FURI_DEBUG FURI_LOG_I(TAG, "subghz_last_settings_load"); @@ -45,7 +46,7 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count uint32_t temp_frequency = 0; uint32_t temp_frequency_analyzer_feedback_level = 0; - int32_t temp_preset = 0; + //int32_t temp_preset = 0; bool frequency_analyzer_feedback_level_was_read = false; #ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING uint32_t temp_read_raw = 0; @@ -53,8 +54,9 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count if(FSE_OK == storage_sd_status(storage) && SUBGHZ_LAST_SETTINGS_PATH && flipper_format_file_open_existing(fff_data_file, SUBGHZ_LAST_SETTINGS_PATH)) { + /* flipper_format_read_int32( - fff_data_file, SUBGHZ_LAST_SETTING_FIELD_PRESET, (int32_t*)&temp_preset, 1); + fff_data_file, SUBGHZ_LAST_SETTING_FIELD_PRESET, (int32_t*)&temp_preset, 1);*/ flipper_format_read_uint32( fff_data_file, SUBGHZ_LAST_SETTING_FIELD_FREQUENCY, (uint32_t*)&temp_frequency, 1); frequency_analyzer_feedback_level_was_read = flipper_format_read_uint32( @@ -89,12 +91,12 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count instance->detect_raw = temp_read_raw; #endif - if(temp_preset > (int32_t)preset_count - 1 || temp_preset < 0) { - FURI_LOG_W(TAG, "Last used preset no found"); - instance->preset = SUBGHZ_LAST_SETTING_DEFAULT_PRESET; - } else { + /*if(temp_preset > (int32_t)preset_count - 1 || temp_preset < 0) { + FURI_LOG_W(TAG, "Last used preset no found");*/ + instance->preset = SUBGHZ_LAST_SETTING_DEFAULT_PRESET; + /*/} else { instance->preset = temp_preset; - } + }*/ } flipper_format_file_close(fff_data_file); @@ -125,10 +127,11 @@ bool subghz_last_settings_save(SubGhzLastSettings* instance) { file, SUBGHZ_LAST_SETTING_FILE_TYPE, SUBGHZ_LAST_SETTING_FILE_VERSION)) break; + /* if(!flipper_format_insert_or_update_int32( file, SUBGHZ_LAST_SETTING_FIELD_PRESET, &instance->preset, 1)) { break; - } + }*/ if(!flipper_format_insert_or_update_uint32( file, SUBGHZ_LAST_SETTING_FIELD_FREQUENCY, &instance->frequency, 1)) { break;