mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-16 11:17:52 -06:00
io.h: read/write[bwl] should use barrier
Add barrier() calls to low-level read/write io calls so that their callers don't need to. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9c1bf1387c
commit
5beceaae5c
3 changed files with 13 additions and 9 deletions
|
@ -126,12 +126,10 @@ console_get_output(uint8_t len)
|
|||
return NULL;
|
||||
// Disable TX irq and move buffer
|
||||
writeb(&transmit_max, 0);
|
||||
barrier();
|
||||
tpos = readb(&transmit_pos);
|
||||
tmax -= tpos;
|
||||
memmove(&transmit_buf[0], &transmit_buf[tpos], tmax);
|
||||
writeb(&transmit_pos, 0);
|
||||
barrier();
|
||||
writeb(&transmit_max, tmax);
|
||||
enable_tx_irq();
|
||||
return &transmit_buf[tmax];
|
||||
|
@ -141,7 +139,6 @@ console_get_output(uint8_t len)
|
|||
void
|
||||
console_push_output(uint8_t len)
|
||||
{
|
||||
barrier();
|
||||
writeb(&transmit_max, readb(&transmit_max) + len);
|
||||
enable_tx_irq();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue