Skip to content

Commit 7f09f5f

Browse files
authored
Merge pull request #273 from darmiel/feat/playlist
feat[infrared]: allow disabling automatic signal decoding
2 parents dfe141c + 4ec5dbc commit 7f09f5f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

applications/main/infrared/scenes/infrared_scene_start.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
enum SubmenuIndex {
44
SubmenuIndexUniversalRemotes,
55
SubmenuIndexLearnNewRemote,
6+
SubmenuIndexLearnNewRemoteRaw,
67
SubmenuIndexSavedRemotes,
78
SubmenuIndexDebug
89
};
@@ -37,6 +38,12 @@ void infrared_scene_start_on_enter(void* context) {
3738
infrared);
3839

3940
if(infrared->app_state.is_debug_enabled) {
41+
submenu_add_item(
42+
submenu,
43+
"Learn New Remote RAW",
44+
SubmenuIndexLearnNewRemoteRaw,
45+
infrared_scene_start_submenu_callback,
46+
infrared);
4047
submenu_add_item(
4148
submenu, "Debug", SubmenuIndexDebug, infrared_scene_start_submenu_callback, infrared);
4249
}
@@ -61,7 +68,15 @@ bool infrared_scene_start_on_event(void* context, SceneManagerEvent event) {
6168
if(submenu_index == SubmenuIndexUniversalRemotes) {
6269
scene_manager_next_scene(scene_manager, InfraredSceneUniversal);
6370
consumed = true;
64-
} else if(submenu_index == SubmenuIndexLearnNewRemote) {
71+
} else if(
72+
submenu_index == SubmenuIndexLearnNewRemote ||
73+
submenu_index == SubmenuIndexLearnNewRemoteRaw) {
74+
75+
// enable automatic signal decoding if "Learn New Remote"
76+
// disable automatic signal decoding if "Learn New Remote (RAW)"
77+
infrared_worker_rx_enable_signal_decoding(
78+
infrared->worker, submenu_index == SubmenuIndexLearnNewRemote);
79+
6580
infrared->app_state.is_learning_new_remote = true;
6681
scene_manager_next_scene(scene_manager, InfraredSceneLearn);
6782
consumed = true;

0 commit comments

Comments
 (0)