LUFA ring buffer init problem

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

I have an atmega16u2 project using LUFA for HID. I added a serial device and decided to use LUFA lightwight ring buffer to manage serial stream. But I started getting "USB device not recognized" messages when I added my ring buffer code. Long story short, when I remove all other ring buffer activites, it appears that the initalizion of the ring buffer is the start/cause the problem. What silly thing have I overlooked?

RingBuffer_t BTtoFF_Buffer; 

uint8_t  BTtoFF_Buffer_Data[128];

RingBuffer_InitBuffer(&BTtoFF_Buffer,BTtoFF_Buffer_Data, sizeof(BTtoFF_Buffer_Data)); 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm guessing I need to go find ye' old stack monitor code and see what going on.

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

16 rather than 128 bytes would probably be more "normal" anyway. If you really can get to a point where 128 received characters are unhandled you may want to revisit your overall design.

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

Yep, agreed, 128 was the result of lazy cut-paste, and I ended up in the stack.