Skip to content
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

WIP: uart: Byteverlust bei der Übertragung #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

swappad
Copy link
Collaborator

@swappad swappad commented May 19, 2021

No description provided.

uart.c Outdated
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) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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.

2 participants