From ad1c9045af46a8a3ea4afc09ba0f5d67b28f0586 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:56:35 +0300 Subject: [PATCH] use global counter --- lib/subghz/protocols/hay21.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/subghz/protocols/hay21.c b/lib/subghz/protocols/hay21.c index 32f9de1de..21d186df8 100644 --- a/lib/subghz/protocols/hay21.c +++ b/lib/subghz/protocols/hay21.c @@ -146,10 +146,10 @@ static void subghz_protocol_encoder_hay21_get_upload(SubGhzProtocolEncoderHay21* // Counter increment if(instance->generic.cnt < 0xF) { - if((instance->generic.cnt + 0x1) > 0xF) { + if((instance->generic.cnt + furi_hal_subghz_get_rolling_counter_mult()) > 0xF) { instance->generic.cnt = 0; } else { - instance->generic.cnt++; + instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult(); } } else if(instance->generic.cnt >= 0xF) { instance->generic.cnt = 0;