From 885bb0c730dcbdfd90439e154b86336712e76862 Mon Sep 17 00:00:00 2001 From: Daniel <71837281+darmiel@users.noreply.github.com> Date: Sat, 27 Aug 2022 01:39:06 +0200 Subject: [PATCH] fix[infrared]: clear records on remote switch --- applications/infrared/infrared_brute_force.c | 4 ++++ applications/infrared/infrared_brute_force.h | 1 + .../infrared/scenes/common/infrared_scene_universal_common.c | 1 + 3 files changed, 6 insertions(+) diff --git a/applications/infrared/infrared_brute_force.c b/applications/infrared/infrared_brute_force.c index 8dbc23012..89272de7e 100644 --- a/applications/infrared/infrared_brute_force.c +++ b/applications/infrared/infrared_brute_force.c @@ -35,6 +35,10 @@ InfraredBruteForce* infrared_brute_force_alloc() { return brute_force; } +void infrared_brute_force_clear_records(InfraredBruteForce* brute_force) { + InfraredBruteForceRecordDict_reset(brute_force->records); +} + void infrared_brute_force_free(InfraredBruteForce* brute_force) { furi_assert(!brute_force->ff); InfraredBruteForceRecordDict_clear(brute_force->records); diff --git a/applications/infrared/infrared_brute_force.h b/applications/infrared/infrared_brute_force.h index acf0d7b6e..fff472e79 100644 --- a/applications/infrared/infrared_brute_force.h +++ b/applications/infrared/infrared_brute_force.h @@ -16,6 +16,7 @@ bool infrared_brute_force_start( bool infrared_brute_force_is_started(InfraredBruteForce* brute_force); void infrared_brute_force_stop(InfraredBruteForce* brute_force); bool infrared_brute_force_send_next(InfraredBruteForce* brute_force); +void infrared_brute_force_clear_records(InfraredBruteForce* brute_force); void infrared_brute_force_add_record( InfraredBruteForce* brute_force, uint32_t index, diff --git a/applications/infrared/scenes/common/infrared_scene_universal_common.c b/applications/infrared/scenes/common/infrared_scene_universal_common.c index 9f1eabd24..1072549ff 100644 --- a/applications/infrared/scenes/common/infrared_scene_universal_common.c +++ b/applications/infrared/scenes/common/infrared_scene_universal_common.c @@ -33,6 +33,7 @@ static void infrared_scene_universal_common_hide_popup(Infrared* infrared) { void infrared_scene_universal_common_on_enter(void* context) { Infrared* infrared = context; + infrared_brute_force_clear_records(infrared->brute_force); button_panel_reset_selection(infrared->button_panel); view_stack_add_view(infrared->view_stack, button_panel_get_view(infrared->button_panel)); }