1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

Fix keeloq custom buttons bug

When you receive couple signals on read screen and open last one it was replacing its button with first one received
This commit is contained in:
MX
2023-04-19 11:51:08 +03:00
parent 059053b9b8
commit c6e5ca1fec
3 changed files with 7 additions and 3 deletions

View File

@@ -115,6 +115,9 @@ void subghz_scene_receiver_info_draw_widget(SubGhz* subghz) {
void subghz_scene_receiver_info_on_enter(void* context) {
SubGhz* subghz = context;
keeloq_reset_original_btn();
subghz_custom_btns_reset();
subghz_scene_receiver_info_draw_widget(subghz);
}

View File

@@ -52,6 +52,10 @@ bool subghz_scene_transmitter_update_data_show(void* context) {
void subghz_scene_transmitter_on_enter(void* context) {
SubGhz* subghz = context;
keeloq_reset_original_btn();
subghz_custom_btns_reset();
if(!subghz_scene_transmitter_update_data_show(subghz)) {
view_dispatcher_send_custom_event(
subghz->view_dispatcher, SubGhzCustomEventViewTransmitterError);

View File

@@ -393,7 +393,6 @@ static bool
uint8_t custom_btn_id = subghz_custom_btn_get();
uint8_t original_btn_num = subghz_custom_btn_get_original();
// Set custom button
if(custom_btn_id == 1) {
switch(original_btn_num) {
@@ -499,11 +498,9 @@ static bool
break;
}
}
if((custom_btn_id == 0) && (original_btn_num != 0)) {
btn = original_btn_num;
}
// Generate new key
if(subghz_protocol_keeloq_gen_data(instance, btn, true)) {