[FL-2729] SubGhz: fix bett decoder (#1573)

* SubGhz: fix bett decoder
* SubGhz: fix duration preamble bett protocol

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm 2022-08-11 19:21:13 +04:00 committed by GitHub
parent aab8ce5e3a
commit 36b8dfe655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {