From 36b8dfe655dce5310099e33aff16aa5cfa8d7453 Mon Sep 17 00:00:00 2001 From: Skorpionm <85568270+Skorpionm@users.noreply.github.com> Date: Thu, 11 Aug 2022 19:21:13 +0400 Subject: [PATCH] [FL-2729] SubGhz: fix bett decoder (#1573) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SubGhz: fix bett decoder * SubGhz: fix duration preamble bett protocol Co-authored-by: あく --- lib/subghz/protocols/bett.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/subghz/protocols/bett.c b/lib/subghz/protocols/bett.c index e32679d2..bd3b45fe 100644 --- a/lib/subghz/protocols/bett.c +++ b/lib/subghz/protocols/bett.c @@ -231,16 +231,16 @@ void subghz_protocol_decoder_bett_feed(void* context, bool level, uint32_t durat switch(instance->decoder.parser_step) { case BETTDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, subghz_protocol_bett_const.te_short * 42) < - subghz_protocol_bett_const.te_delta * 21)) { + if((!level) && (DURATION_DIFF(duration, subghz_protocol_bett_const.te_short * 44) < + (subghz_protocol_bett_const.te_delta * 15))) { //Found Preambula instance->decoder.parser_step = BETTDecoderStepCheckDuration; } break; case BETTDecoderStepSaveDuration: if(!level) { - if(duration >= ((uint32_t)subghz_protocol_bett_const.te_short * 10 + - subghz_protocol_bett_const.te_delta)) { + if(DURATION_DIFF(duration, subghz_protocol_bett_const.te_short * 44) < + (subghz_protocol_bett_const.te_delta * 15)) { instance->decoder.parser_step = BETTDecoderStepSaveDuration; if(instance->decoder.decode_count_bit == subghz_protocol_bett_const.min_count_bit_for_found) {