Skip to content

Commit

Permalink
Repair MarlinSerial with TX-buffer
Browse files Browse the repository at this point in the history
These '{' are important to avoid the redefinition of `unsigned char _sreg = SREG;`
at the same level.
Used in
```
#define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
```
  • Loading branch information
AnHardt committed Aug 22, 2016
1 parent 6b274e5 commit 7e36b76
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Marlin/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ void MarlinSerial::flush(void) {
}

tx_buffer.buffer[tx_buffer.head] = c;
CRITICAL_SECTION_START;
tx_buffer.head = i;
SBI(M_UCSRxB, M_UDRIEx);
CRITICAL_SECTION_END;
{ CRITICAL_SECTION_START;
tx_buffer.head = i;
SBI(M_UCSRxB, M_UDRIEx);
CRITICAL_SECTION_END;
}
return;
}

Expand Down

0 comments on commit 7e36b76

Please sign in to comment.