WS: fix Acurite-606TX protocol (#1938)
* WS: fix acurite_606tx protocol * WS: update version * WeatherStation: remove break from invalid place Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
f11df49468
commit
26f852839a
@ -3,7 +3,7 @@
|
|||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
|
||||||
#define WS_VERSION_APP "0.3"
|
#define WS_VERSION_APP "0.3.1"
|
||||||
#define WS_DEVELOPED "SkorP"
|
#define WS_DEVELOPED "SkorP"
|
||||||
#define WS_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
|
#define WS_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
|
||||||
|
|
||||||
|
@ -151,10 +151,11 @@ void ws_protocol_decoder_acurite_606tx_feed(void* context, bool level, uint32_t
|
|||||||
|
|
||||||
case Acurite_606TXDecoderStepCheckDuration:
|
case Acurite_606TXDecoderStepCheckDuration:
|
||||||
if(!level) {
|
if(!level) {
|
||||||
if((DURATION_DIFF(instance->decoder.te_last, ws_protocol_acurite_606tx_const.te_short) <
|
if(DURATION_DIFF(instance->decoder.te_last, ws_protocol_acurite_606tx_const.te_short) <
|
||||||
ws_protocol_acurite_606tx_const.te_delta) &&
|
ws_protocol_acurite_606tx_const.te_delta) {
|
||||||
(DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_short) <
|
if((DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_short) <
|
||||||
ws_protocol_acurite_606tx_const.te_delta)) {
|
ws_protocol_acurite_606tx_const.te_delta) ||
|
||||||
|
(duration > ws_protocol_acurite_606tx_const.te_long * 3)) {
|
||||||
//Found syncPostfix
|
//Found syncPostfix
|
||||||
instance->decoder.parser_step = Acurite_606TXDecoderStepReset;
|
instance->decoder.parser_step = Acurite_606TXDecoderStepReset;
|
||||||
if((instance->decoder.decode_count_bit ==
|
if((instance->decoder.decode_count_bit ==
|
||||||
@ -168,22 +169,14 @@ void ws_protocol_decoder_acurite_606tx_feed(void* context, bool level, uint32_t
|
|||||||
}
|
}
|
||||||
instance->decoder.decode_data = 0;
|
instance->decoder.decode_data = 0;
|
||||||
instance->decoder.decode_count_bit = 0;
|
instance->decoder.decode_count_bit = 0;
|
||||||
|
|
||||||
break;
|
|
||||||
} else if(
|
} else if(
|
||||||
(DURATION_DIFF(
|
DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_long) <
|
||||||
instance->decoder.te_last, ws_protocol_acurite_606tx_const.te_short) <
|
ws_protocol_acurite_606tx_const.te_delta * 2) {
|
||||||
ws_protocol_acurite_606tx_const.te_delta) &&
|
|
||||||
(DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_long) <
|
|
||||||
ws_protocol_acurite_606tx_const.te_delta * 2)) {
|
|
||||||
subghz_protocol_blocks_add_bit(&instance->decoder, 0);
|
subghz_protocol_blocks_add_bit(&instance->decoder, 0);
|
||||||
instance->decoder.parser_step = Acurite_606TXDecoderStepSaveDuration;
|
instance->decoder.parser_step = Acurite_606TXDecoderStepSaveDuration;
|
||||||
} else if(
|
} else if(
|
||||||
(DURATION_DIFF(
|
DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_long * 2) <
|
||||||
instance->decoder.te_last, ws_protocol_acurite_606tx_const.te_short) <
|
ws_protocol_acurite_606tx_const.te_delta * 4) {
|
||||||
ws_protocol_acurite_606tx_const.te_delta) &&
|
|
||||||
(DURATION_DIFF(duration, ws_protocol_acurite_606tx_const.te_long * 2) <
|
|
||||||
ws_protocol_acurite_606tx_const.te_delta * 4)) {
|
|
||||||
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
|
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
|
||||||
instance->decoder.parser_step = Acurite_606TXDecoderStepSaveDuration;
|
instance->decoder.parser_step = Acurite_606TXDecoderStepSaveDuration;
|
||||||
} else {
|
} else {
|
||||||
@ -192,6 +185,9 @@ void ws_protocol_decoder_acurite_606tx_feed(void* context, bool level, uint32_t
|
|||||||
} else {
|
} else {
|
||||||
instance->decoder.parser_step = Acurite_606TXDecoderStepReset;
|
instance->decoder.parser_step = Acurite_606TXDecoderStepReset;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
instance->decoder.parser_step = Acurite_606TXDecoderStepReset;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user