mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
SubGHz: Refactor last settings logic
This commit is contained in:
@@ -207,16 +207,9 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
||||
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);
|
||||
#ifdef FURI_DEBUG
|
||||
subghz_last_settings_log(subghz->last_settings);
|
||||
#endif
|
||||
if(!alloc_for_tx_only) {
|
||||
#if SUBGHZ_LAST_SETTING_SAVE_PRESET
|
||||
subghz_txrx_set_preset_internal(
|
||||
subghz->txrx, subghz->last_settings->frequency, subghz->last_settings->preset_index);
|
||||
#else
|
||||
subghz_txrx_set_default_preset(subghz->txrx, subghz->last_settings->frequency);
|
||||
#endif
|
||||
subghz->history = subghz_history_alloc();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user