From 5a29168eaddaaa47909f2ae84c41d0743996215f Mon Sep 17 00:00:00 2001 From: henryk Date: Fri, 14 Dec 2007 23:13:20 +0000 Subject: Sanitize and clarify the len handling in rx buffers. Fix miller decoder git-svn-id: https://svn.openpcd.org:2342/trunk@387 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/ssc_picc.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'openpicc/application/ssc_picc.h') diff --git a/openpicc/application/ssc_picc.h b/openpicc/application/ssc_picc.h index 5eb1160..a01b16d 100644 --- a/openpicc/application/ssc_picc.h +++ b/openpicc/application/ssc_picc.h @@ -48,7 +48,7 @@ typedef enum { } ssc_metric; extern int ssc_get_metric(ssc_metric metric); -#define SSC_DMA_BUFFER_SIZE 2048 +#define SSC_RX_BUFFER_SIZE 2048 #define SSC_DMA_BUFFER_COUNT 4 typedef enum { @@ -59,11 +59,17 @@ typedef enum { PREFILLED, /* The buffer has been prefilled for later usage (only used for TX) */ } ssc_dma_buffer_state_t; +typedef struct { + enum ssc_mode mode; + u_int16_t transfersize; + u_int16_t transfers; +} ssc_mode_def; + typedef struct { volatile ssc_dma_buffer_state_t state; - u_int32_t len; /* Length of the content */ - enum ssc_mode reception_mode; /* The SSC mode that the buffer has been loaded for (affects element size and count) */ - u_int8_t data[SSC_DMA_BUFFER_SIZE]; + u_int32_t len; /* Length of the content, in samples */ + const ssc_mode_def *reception_mode; /* Pointer to the SSC mode definition that the buffer has been loaded for (affects element size and count) */ + u_int8_t data[SSC_RX_BUFFER_SIZE]; } ssc_dma_rx_buffer_t; extern xQueueHandle ssc_rx_queue; -- cgit v1.2.3