force only default mods

This commit is contained in:
MX
2025-04-12 03:11:03 +03:00
parent 455bb8ab1f
commit 75f5d6fec7
2 changed files with 4 additions and 3 deletions

View File

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

View File

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