From a4b9d6de0673f16c82b295ffc4778f6361e81fe8 Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Fri, 10 Feb 2017 18:12:32 -0500 Subject: use decoding contexts to separate simultaneous lighthouse ootx decoding. --- tools/ootx_decode/ootx_decoder.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tools/ootx_decode/ootx_decoder.h') diff --git a/tools/ootx_decode/ootx_decoder.h b/tools/ootx_decode/ootx_decoder.h index 3a14f74..2c0ee63 100644 --- a/tools/ootx_decode/ootx_decoder.h +++ b/tools/ootx_decode/ootx_decoder.h @@ -14,8 +14,21 @@ typedef struct { uint32_t crc32; } ootx_packet; -void ootx_init_buffer(); -void ootx_process_bit(uint32_t length); +typedef struct { + uint8_t* buffer; + uint16_t buf_offset; + uint8_t bits_written; + uint16_t* payload_size; + + uint32_t preamble; + uint8_t bits_processed; + uint8_t found_preamble; +} ootx_decoder_context; + + +//void ootx_init_buffer(); +void ootx_process_bit(ootx_decoder_context *ctx, uint32_t length); +void ootx_init_decoder_context(ootx_decoder_context *ctx); extern void (*ootx_packet_clbk)(ootx_packet* packet); -- cgit v1.2.3