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

Fix #370 and fix other protocol counter

This commit is contained in:
MX
2023-02-28 21:45:55 +03:00
parent e0f9697750
commit 8deb29a8ff
2 changed files with 3 additions and 10 deletions

View File

@@ -379,11 +379,8 @@ static void subghz_protocol_secplus_v2_encode(SubGhzProtocolEncoderSecPlus_v2* i
uint8_t roll_1[9] = {0};
uint8_t roll_2[9] = {0};
if((instance->generic.cnt + furi_hal_subghz_get_rolling_counter_mult()) >= 0xFFFF) {
instance->generic.cnt = 0;
} else {
instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult();
}
instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult();
//ToDo it is not known what value the counter starts
if(instance->generic.cnt > 0xFFFFFFF) instance->generic.cnt = 0xE500000;
uint32_t rolling = subghz_protocol_blocks_reverse_key(instance->generic.cnt, 28);