Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@
const bool isr_enabled = TEST(M_UCSRxB, M_RXCIEx);
CBI(M_UCSRxB, M_RXCIEx);
#endif
const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];

const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];

#if RX_BUFFER_SIZE > 256
// Reenable RX interrupts if they were enabled
if (isr_enabled) SBI(M_UCSRxB, M_RXCIEx);
Expand Down Expand Up @@ -343,7 +345,7 @@
CBI(M_UCSRxB, M_RXCIEx);
#endif

const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;

#if RX_BUFFER_SIZE > 256
if (isr_enabled) SBI(M_UCSRxB, M_RXCIEx);
Expand All @@ -358,7 +360,7 @@
CBI(M_UCSRxB, M_RXCIEx);
#endif

rx_buffer.tail = rx_buffer.head;
rx_buffer.tail = rx_buffer.head;

#if RX_BUFFER_SIZE > 256
if (isr_enabled) SBI(M_UCSRxB, M_RXCIEx);
Expand Down