From 75f5d6fec7715413c3792afa1c3633305abf2814 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 12 Apr 2025 03:11:03 +0300 Subject: [PATCH] force only default mods --- applications/main/subghz/subghz.c | 4 ++-- applications/main/subghz/subghz_last_settings.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index d07eff2b3..c68639c0d 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -199,8 +199,8 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { // Load last used values for Read, Read RAW, etc. or default subghz->last_settings = subghz_last_settings_alloc(); - size_t preset_count = subghz_setting_get_preset_count(setting); - subghz_last_settings_load(subghz->last_settings, preset_count); + //size_t preset_count = subghz_setting_get_preset_count(setting); + subghz_last_settings_load(subghz->last_settings, 0); // Set LED and Amp GPIO control state furi_hal_subghz_set_ext_leds_and_amp(subghz->last_settings->leds_and_amp); diff --git a/applications/main/subghz/subghz_last_settings.c b/applications/main/subghz/subghz_last_settings.c index 174a15a5b..6ffdc858e 100644 --- a/applications/main/subghz/subghz_last_settings.c +++ b/applications/main/subghz/subghz_last_settings.c @@ -31,6 +31,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); // Default values (all others set to 0, if read from file fails these are used) @@ -148,7 +149,7 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count instance->frequency = SUBGHZ_LAST_SETTING_DEFAULT_FREQUENCY; } - if(instance->preset_index > (uint32_t)preset_count - 1) { + if(instance->preset_index > 3) { instance->preset_index = SUBGHZ_LAST_SETTING_DEFAULT_PRESET; } }