Просмотр исходного кода

SubGhz: fix decoder kelooq (#1719)

* SubGhz: fix decoder kelooq

Co-authored-by: hedger <hedger@users.noreply.github.com>
Skorpionm 3 лет назад
Родитель
Сommit
e9ab581771
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      lib/subghz/protocols/keeloq.c

+ 2 - 2
lib/subghz/protocols/keeloq.c

@@ -407,7 +407,7 @@ void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t dur
                 (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_keeloq_const.te_short) <
                 (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_keeloq_const.te_short) <
                  subghz_protocol_keeloq_const.te_delta) &&
                  subghz_protocol_keeloq_const.te_delta) &&
                 (DURATION_DIFF(duration, subghz_protocol_keeloq_const.te_long) <
                 (DURATION_DIFF(duration, subghz_protocol_keeloq_const.te_long) <
-                 subghz_protocol_keeloq_const.te_delta)) {
+                 subghz_protocol_keeloq_const.te_delta * 2)) {
                 if(instance->decoder.decode_count_bit <
                 if(instance->decoder.decode_count_bit <
                    subghz_protocol_keeloq_const.min_count_bit_for_found) {
                    subghz_protocol_keeloq_const.min_count_bit_for_found) {
                     subghz_protocol_blocks_add_bit(&instance->decoder, 1);
                     subghz_protocol_blocks_add_bit(&instance->decoder, 1);
@@ -415,7 +415,7 @@ void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t dur
                 instance->decoder.parser_step = KeeloqDecoderStepSaveDuration;
                 instance->decoder.parser_step = KeeloqDecoderStepSaveDuration;
             } else if(
             } else if(
                 (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_keeloq_const.te_long) <
                 (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_keeloq_const.te_long) <
-                 subghz_protocol_keeloq_const.te_delta) &&
+                 subghz_protocol_keeloq_const.te_delta * 2) &&
                 (DURATION_DIFF(duration, subghz_protocol_keeloq_const.te_short) <
                 (DURATION_DIFF(duration, subghz_protocol_keeloq_const.te_short) <
                  subghz_protocol_keeloq_const.te_delta)) {
                  subghz_protocol_keeloq_const.te_delta)) {
                 if(instance->decoder.decode_count_bit <
                 if(instance->decoder.decode_count_bit <