Skip to content

Commit

Permalink
hay21 add 3rd button
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Sep 6, 2024
1 parent 7333c55 commit 8d731f3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/subghz/protocols/hay21.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ static uint8_t subghz_protocol_hay21_get_btn_code(void) {
case 0xC3:
btn = 0x5A;
break;
case 0x88:
btn = 0x5A;
break;

default:
break;
}
} else if(custom_btn_id == SUBGHZ_CUSTOM_BTN_LEFT) {
switch(original_btn_code) {
case 0x5A:
btn = 0x88;
break;
case 0xC3:
btn = 0x88;
break;
case 0x88:
btn = 0xC3;
break;

default:
break;
Expand Down Expand Up @@ -191,7 +209,7 @@ static void subghz_protocol_hay21_remote_controller(SubGhzBlockGeneric* instance
if(subghz_custom_btn_get_original() == 0) {
subghz_custom_btn_set_original(instance->btn);
}
subghz_custom_btn_set_max(1);
subghz_custom_btn_set_max(2);

// Hay21 Decoder
// 09.2024 - @xMasterX (MMX)
Expand Down Expand Up @@ -392,6 +410,9 @@ static const char* subghz_protocol_hay21_get_button_name(uint8_t btn) {
case 0xC3:
btn_name = "Mode";
break;
case 0x88:
btn_name = "Hold";
break;
default:
btn_name = "Unknown";
break;
Expand Down

0 comments on commit 8d731f3

Please sign in to comment.