From 5eb520fccef25a4aacca542c7c88d7012d610008 Mon Sep 17 00:00:00 2001 From: Ed Gonzalez Date: Tue, 16 Jun 2015 18:14:34 -0500 Subject: [PATCH] Move header, voice_bits and data_bits into the dstar_machine data structure for future support of multiple instances --- DSP_API/ThumbDV/dstar.c | 8 ++++---- DSP_API/ThumbDV/dstar.h | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DSP_API/ThumbDV/dstar.c b/DSP_API/ThumbDV/dstar.c index ccacc2e..a2e8afa 100644 --- a/DSP_API/ThumbDV/dstar.c +++ b/DSP_API/ThumbDV/dstar.c @@ -493,10 +493,10 @@ BOOL dstar_stateMachine(DSTAR_MACHINE machine, BOOL in_bit, unsigned char * ambe BOOL have_audio_packet = FALSE; BOOL found_syn_bits = FALSE; BOOL found_end_bits = FALSE; - static BOOL header[FEC_SECTION_LENGTH_BITS]; - static BOOL voice_bits[72]; - //static BOOL data_bits[(24+72) * 50]; - static BOOL data_bits[24]; + BOOL * header = machine->header; + BOOL * voice_bits = machine->voice_bits; + BOOL * data_bits = machine->data_bits; + //unsigned char bytes[((24+72) * 50)/8 + 1]; unsigned char bytes[FEC_SECTION_LENGTH_BITS/8 + 1]; diff --git a/DSP_API/ThumbDV/dstar.h b/DSP_API/ThumbDV/dstar.h index da2e124..d7f5d80 100644 --- a/DSP_API/ThumbDV/dstar.h +++ b/DSP_API/ThumbDV/dstar.h @@ -64,10 +64,16 @@ typedef struct _dstar_machine uint32 bit_count; uint32 frame_count; + /* BIT Pattern Matcher */ BIT_PM syn_pm; BIT_PM data_sync_pm; BIT_PM end_pm; + /* Bit Buffers */ + BOOL header[FEC_SECTION_LENGTH_BITS]; + BOOL voice_bits[VOICE_FRAME_LENGTH_BITS]; + BOOL data_bits[DATA_FRAME_LENGTH_BITS]; + } dstar_machine, * DSTAR_MACHINE; typedef struct _dstar_fec