[FL-2848] Universal Remote fix (#1770)

* Reset BruteForce on exit from Universal Remote
* Reset current button in ButtonPanel
This commit is contained in:
Georgii Surkov 2022-09-22 19:13:00 +03:00 committed by GitHub
parent e70121e20f
commit 17d01f5c29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View file

@ -153,3 +153,7 @@ void infrared_brute_force_add_record(
InfraredBruteForceRecordDict_set_at(brute_force->records, key, value);
string_clear(key);
}
void infrared_brute_force_reset(InfraredBruteForce* brute_force) {
InfraredBruteForceRecordDict_reset(brute_force->records);
}

View file

@ -20,3 +20,4 @@ void infrared_brute_force_add_record(
InfraredBruteForce* brute_force,
uint32_t index,
const char* name);
void infrared_brute_force_reset(InfraredBruteForce* brute_force);

View file

@ -87,5 +87,6 @@ void infrared_scene_universal_common_on_exit(void* context) {
Infrared* infrared = context;
ButtonPanel* button_panel = infrared->button_panel;
view_stack_remove_view(infrared->view_stack, button_panel_get_view(button_panel));
infrared_brute_force_reset(infrared->brute_force);
button_panel_reset(button_panel);
}

View file

@ -133,6 +133,8 @@ void button_panel_reset(ButtonPanel* button_panel) {
}
model->reserve_x = 0;
model->reserve_y = 0;
model->selected_item_x = 0;
model->selected_item_y = 0;
LabelList_reset(model->labels);
ButtonMatrix_reset(model->button_matrix);
return true;