LightweightRingBuff.h

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can not find any recent thread on this topic, so here is a new one.

I am attempting to use LightweightRingBuff.h and having compile errors.

It seems that there are several versions of his out in the wild including the LUFA version. 

I am trying http://www.fourwalledcubicle.com/files/LightweightRingBuff.h 

The example in the manual is not quit in sync with the version above.

http://www.fourwalledcubicle.com...

 

 

Error    1    expected declaration specifiers or '...' before '&' token    file:   deanSerialTestINT.c    

This refer to the last line in the code snip

#include "LightweightRingBuff.h"

// Create the buffer structure and its underlying storage array
RingBuff_t rxBuffer;
RingBuff_Data_t     rxBufferData[BUFFER_SIZE];

RingBuffer_InitBuffer(&rxBuffer);

Also I am confused by the line (from the example in the manual)

RingBuff_Data_t rxBufferData[BUFFER_SIZE];

Is this not defined in the struct?

 

 

I m using Atmel Studio 6.2 1153

KWC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The LUFA documentation is presumably talking about the "lightweight ring buffer" in .../LUFA/Drivers/Misc/RingBuffer.h, rather than the the one you found.   They're substantially different.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The code in #1 is clearly an excerpt and not the entire file (otherwise you have a function call outside of the body of a function!) so perhaps show the entire file?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(otherwise you have a function call outside of the body of a function!)

Well now don't I feel silly. That is exactly the issue.  It seems I have found yet another way to make silly errors.

Thanks!