Changed buffer from volatile pointers to non-volatile data, to pointers to volatile variables.

This commit is contained in:
skarg
2012-01-25 19:03:54 +00:00
parent bae2321abc
commit 6c5fe45769
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -43,7 +43,7 @@
#include <stdbool.h>
struct ring_buffer_t {
uint8_t * volatile buffer; /* block of memory or array of data */
volatile uint8_t * buffer; /* block of memory or array of data */
unsigned element_size; /* how many bytes for each chunk */
unsigned element_count; /* number of chunks of data */
volatile unsigned head; /* where the writes go */
@@ -73,7 +73,7 @@ extern "C" {
/* Note: element_count must be a power of two */
void Ringbuf_Init(
RING_BUFFER * b, /* ring buffer structure */
uint8_t * volatile buffer, /* data block or array of data */
volatile uint8_t * buffer, /* data block or array of data */
unsigned element_size, /* size of one element in the data block */
unsigned element_count); /* number of elements in the data block */
+1 -1
View File
@@ -186,7 +186,7 @@ uint8_t *Ringbuf_Alloc(
*****************************************************************************/
void Ringbuf_Init(
RING_BUFFER * b, /* ring buffer structure */
uint8_t * volatile buffer, /* data block or array of data */
volatile uint8_t * buffer, /* data block or array of data */
unsigned element_size, /* size of one element in the data block */
unsigned element_count)
{ /* number of elements in the data block */