From 4ec5dbcee828519778f429d8f59f7538641fa1be Mon Sep 17 00:00:00 2001 From: Daniel <71837281+darmiel@users.noreply.github.com> Date: Sun, 8 Jan 2023 02:05:17 +0100 Subject: [PATCH] feat: allow disabling automatic signal decoding --- .../main/infrared/scenes/infrared_scene_start.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/applications/main/infrared/scenes/infrared_scene_start.c b/applications/main/infrared/scenes/infrared_scene_start.c index c7df0f45b..32d357dc5 100644 --- a/applications/main/infrared/scenes/infrared_scene_start.c +++ b/applications/main/infrared/scenes/infrared_scene_start.c @@ -3,6 +3,7 @@ enum SubmenuIndex { SubmenuIndexUniversalRemotes, SubmenuIndexLearnNewRemote, + SubmenuIndexLearnNewRemoteRaw, SubmenuIndexSavedRemotes, SubmenuIndexDebug }; @@ -37,6 +38,12 @@ void infrared_scene_start_on_enter(void* context) { infrared); if(infrared->app_state.is_debug_enabled) { + submenu_add_item( + submenu, + "Learn New Remote RAW", + SubmenuIndexLearnNewRemoteRaw, + infrared_scene_start_submenu_callback, + infrared); submenu_add_item( submenu, "Debug", SubmenuIndexDebug, infrared_scene_start_submenu_callback, infrared); } @@ -61,7 +68,15 @@ bool infrared_scene_start_on_event(void* context, SceneManagerEvent event) { if(submenu_index == SubmenuIndexUniversalRemotes) { scene_manager_next_scene(scene_manager, InfraredSceneUniversal); consumed = true; - } else if(submenu_index == SubmenuIndexLearnNewRemote) { + } else if( + submenu_index == SubmenuIndexLearnNewRemote || + submenu_index == SubmenuIndexLearnNewRemoteRaw) { + + // enable automatic signal decoding if "Learn New Remote" + // disable automatic signal decoding if "Learn New Remote (RAW)" + infrared_worker_rx_enable_signal_decoding( + infrared->worker, submenu_index == SubmenuIndexLearnNewRemote); + infrared->app_state.is_learning_new_remote = true; scene_manager_next_scene(scene_manager, InfraredSceneLearn); consumed = true;