SubGhz: refactoring

This commit is contained in:
gid9798
2023-05-09 21:20:35 +03:00
parent 42a415e449
commit def4ae395e
12 changed files with 573 additions and 558 deletions

View File

@@ -46,14 +46,15 @@ bool subghz_scene_need_saving_on_event(void* context, SceneManagerEvent event) {
scene_manager_previous_scene(subghz->scene_manager);
return true;
} else if(event.event == SubGhzCustomEventSceneExit) {
if(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateExit) {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
SubGhzRxKeyState state = subghz_rx_key_state_get(subghz);
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
if(state) {
subghz_txrx_set_preset(
subghz->txrx, "AM650", subghz->last_settings->frequency, NULL, 0);
scene_manager_search_and_switch_to_previous_scene(
subghz->scene_manager, SubGhzSceneStart);
} else {
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
scene_manager_previous_scene(subghz->scene_manager);
}