SecPlus 2.0 - Add new custom button

Fix issue with add manually
This commit is contained in:
MX 2023-05-28 04:18:32 +03:00
parent a11b6e72dc
commit 1e1b85a575
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
2 changed files with 33 additions and 2 deletions

View file

@ -7,6 +7,7 @@
* SubGHz Remote: Full refactoring, app was re-made from scratch (by @gid9798)
* Archive: Fix rename, show error message to user
* API: Cleanup, mini refactoring of some apps (+6k of free flash space)
* SubGHz: Security+ 2.0 -> add extra custom button `0x78` - Fixes issue #469
* SubGHz: Various fixes (by @gid9798)
* SubGHz: Fix counter settings in debug
* SubGHz: Move dangerous_settings check (by @gid9798 | PR #475)

View file

@ -345,7 +345,7 @@ static void
if(subghz_custom_btn_get_original() == 0) {
subghz_custom_btn_set_original(instance->btn);
}
subghz_custom_btn_set_max(3);
subghz_custom_btn_set_max(4);
}
/**
@ -377,7 +377,7 @@ static uint64_t subghz_protocol_secplus_v2_encode_half(uint8_t roll_array[], uin
/**
* Defines the button value for the current btn_id
* Basic set | 0x68 | 0x80 | 0x81 | 0xE2 |
* Basic set | 0x68 | 0x80 | 0x81 | 0xE2 | 0x78
* @return Button code
*/
static uint8_t subghz_protocol_secplus_v2_get_btn_code();
@ -856,6 +856,9 @@ static uint8_t subghz_protocol_secplus_v2_get_btn_code() {
case 0xE2:
btn = 0x80;
break;
case 0x78:
btn = 0x80;
break;
default:
break;
@ -874,6 +877,9 @@ static uint8_t subghz_protocol_secplus_v2_get_btn_code() {
case 0xE2:
btn = 0x81;
break;
case 0x78:
btn = 0x81;
break;
default:
break;
@ -892,6 +898,30 @@ static uint8_t subghz_protocol_secplus_v2_get_btn_code() {
case 0xE2:
btn = 0x68;
break;
case 0x78:
btn = 0xE2;
break;
default:
break;
}
} else if(custom_btn_id == SUBGHZ_CUSTOM_BTN_RIGHT) {
switch(original_btn_code) {
case 0x68:
btn = 0x78;
break;
case 0x80:
btn = 0x78;
break;
case 0x81:
btn = 0x78;
break;
case 0xE2:
btn = 0x78;
break;
case 0x78:
btn = 0x68;
break;
default:
break;