ソースを参照

Merge pull request #7904 from GMagician/Addressing-#7896

[2.0.x] Addressing #7896
Scott Lahteine 7年前
コミット
e31385ecf6
1個のファイルの変更2行の追加3行の削除
  1. 2
    3
      Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp

+ 2
- 3
Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp ファイルの表示

175
     // If the character is to be stored at the index just before the tail
175
     // If the character is to be stored at the index just before the tail
176
     // (such that the head would advance to the current tail), the buffer is
176
     // (such that the head would advance to the current tail), the buffer is
177
     // critical, so don't write the character or advance the head.
177
     // critical, so don't write the character or advance the head.
178
+    const char c = M_UDRx;
178
     if (i != rx_buffer.tail) {
179
     if (i != rx_buffer.tail) {
179
-      rx_buffer.buffer[h] = M_UDRx;
180
+      rx_buffer.buffer[h] = c;
180
       rx_buffer.head = i;
181
       rx_buffer.head = i;
181
     }
182
     }
182
     else {
183
     else {
183
-      (void)M_UDRx;
184
       #if ENABLED(SERIAL_STATS_DROPPED_RX)
184
       #if ENABLED(SERIAL_STATS_DROPPED_RX)
185
         if (!++rx_dropped_bytes) ++rx_dropped_bytes;
185
         if (!++rx_dropped_bytes) ++rx_dropped_bytes;
186
       #endif
186
       #endif
194
     #endif
194
     #endif
195
 
195
 
196
     #if ENABLED(SERIAL_XON_XOFF)
196
     #if ENABLED(SERIAL_XON_XOFF)
197
-
198
       // for high speed transfers, we can use XON/XOFF protocol to do
197
       // for high speed transfers, we can use XON/XOFF protocol to do
199
       // software handshake and avoid overruns.
198
       // software handshake and avoid overruns.
200
       if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) {
199
       if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) {

読み込み中…
キャンセル
保存