Conversation
swappad
commented
May 19, 2021
Comment on lines
+123
to
131
| if (instances[id].ready && (instances[id].head == instances[id].tail)) { // Can send directly | ||
| instances[id].ready = false; // Luca: indicate queue not empty | ||
| *instances[id].udr = data; | ||
| } else if (instances[id].tail != instances[id].head | ||
| || !instances[id].full) { // Not empty but needs to be added to queue | ||
| instances[id].ready = false; // Luca: indicate queue not empty | ||
| instances[id].data[instances[id].head] = data; | ||
| instances[id].head = (instances[id].head + 1) % RING_BUFFER_SIZE; | ||
| if (instances[id].tail == instances[id].head) { |
Collaborator
Author
There was a problem hiding this comment.
instances[id].head == instances[id].tail vs. instances[id].tail != instances[id].head
Wann ist die Queue
- leer ?
- nicht leer ?
- voll ?
instances[id].head == instances[id].tail wird verwendet für Queue leer und Queue voll. Passt das?
Member
There was a problem hiding this comment.
Wenn Queue voll oder leer ist gilt jeweils head==tail, um das zu unterscheiden gibt es noch den full bool.
Ready wird nur genutzt um zu checken ob die UART Hardware gerade bereit zur Nutzung ist (für den Fall Queue Empty aber Transaktion noch nicht fertig)
remove comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.