Browse Source

Repair MarlinSerial with TX-buffer

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();
```
AnHardt 8 years ago
parent
commit
7e36b76af2
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      Marlin/MarlinSerial.cpp

+ 5
- 4
Marlin/MarlinSerial.cpp View File

244
     }
244
     }
245
 
245
 
246
     tx_buffer.buffer[tx_buffer.head] = c;
246
     tx_buffer.buffer[tx_buffer.head] = c;
247
-    CRITICAL_SECTION_START;
248
-      tx_buffer.head = i;
249
-      SBI(M_UCSRxB, M_UDRIEx);
250
-    CRITICAL_SECTION_END;
247
+    { CRITICAL_SECTION_START;
248
+        tx_buffer.head = i;
249
+        SBI(M_UCSRxB, M_UDRIEx);
250
+      CRITICAL_SECTION_END;
251
+    }
251
     return;
252
     return;
252
   }
253
   }
253
 
254
 

Loading…
Cancel
Save