-
-
Notifications
You must be signed in to change notification settings - Fork 116
Fix available_buffer_size function #1005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm staring at this and struggling to convince myself that either what we had is correct, or what you propose is correct. Perhaps we could use some unit tests for that function, covering the various conditions? |
c0cdb78 to
14dc29a
Compare
|
Alright, I'll write a few tests for this function. Additionally, in fact, in the official RTT implementation (https://github.com/SEGGERMicro/RTT/blob/main/RTT/SEGGER_RTT.c , line 520), the available space in the _GetAvailWriteSpace() function is calculated exactly this way. |
|
Oh... Now this seems like there's something wrong with the testing tool? |
|
The changes here to the algorithm look OK, as do the tests. Please don't do the version bump though. We'll collect a bunch of changes on the main branch and then do a release PR that combines them together in one bump. |
|
Okay, but how should I modify the changelog? |
|
Fine, I consider I fix all problem. |
|
Brilliant, thank you. I hope we can get this released soon. |
In the original implementation, if read < write, the available space between 0 and read would be ignored.