Skip to content

Conversation

@Copper280z
Copy link
Contributor

The CircularBuffer struct was previously reporting the wrong readable/writable length, which allowed the user to overwrite valid parts of the buffer. This is the cause of the rp2xxx usb-cdc example failing to print the whole string.

This adds a test which previously failed, now passes, along with the actual fix, which is just to set the .full member variable to true in the write function when the buffer is full.

add bounds test for CircularBuffer
buffer.full was never set in this function, but it was in
write_assume_capacity.
@Copper280z
Copy link
Contributor Author

My comment about this fixing the rp2xxx cdc example is incorrect, the example still doesn't work with this change.

@mattnite mattnite merged commit a613bfc into ZigEmbeddedGroup:main Jan 5, 2026
52 checks passed
Copper280z added a commit to Copper280z/microzig that referenced this pull request Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants