aboutsummaryrefslogtreecommitdiff
path: root/src/ootx_decoder.c
diff options
context:
space:
mode:
authorJustin Berger <jdavidberger@gmail.com>2018-06-29 18:20:55 +0000
committerJustin Berger <jdavidberger@gmail.com>2018-06-29 18:20:55 +0000
commita7b842727ad11314f2f7ea05c6e07006df10a552 (patch)
treeca73e33007c14a7041ec33122ce867619f5dd6c4 /src/ootx_decoder.c
parentbe357341abbd999051ed8f4e532746b2e7f0a201 (diff)
downloadlibsurvive-a7b842727ad11314f2f7ea05c6e07006df10a552.tar.gz
libsurvive-a7b842727ad11314f2f7ea05c6e07006df10a552.tar.bz2
Added additional options for ootx decoding
Diffstat (limited to 'src/ootx_decoder.c')
-rw-r--r--src/ootx_decoder.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ootx_decoder.c b/src/ootx_decoder.c
index 7d45626..e110d11 100644
--- a/src/ootx_decoder.c
+++ b/src/ootx_decoder.c
@@ -37,6 +37,7 @@ void ootx_init_decoder_context(ootx_decoder_context *ctx) {
ctx->preamble = 0XFFFFFFFF;
ctx->bits_processed = 0;
ctx->found_preamble = 0;
+ ctx->ignore_sync_bit_error = 0;
ctx->buffer = (uint8_t*)malloc(MAX_BUFF_SIZE);
ctx->payload_size = (uint16_t*)ctx->buffer;
@@ -122,9 +123,11 @@ void ootx_pump_bit(ootx_decoder_context *ctx, uint8_t dbit) {
// printf("drop %d\n", dbit);
if( !dbit )
{
- //printf("Bad sync bit\n");
+ // printf("Bad sync bit\n");
ootx_error(ctx, "OOTX Decoder: Bad sync bit");
- ootx_reset_buffer(ctx);
+
+ if (ctx->ignore_sync_bit_error == 0)
+ ootx_reset_buffer(ctx);
}
ctx->bits_processed = 0;
}