浏览代码

Drop return value from Serial::write() (#21567)

Ramiro Polla 4 年前
父节点
当前提交
8048d1411f
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 4 次插入5 次删除
  1. 2
    3
      Marlin/src/HAL/AVR/MarlinSerial.cpp
  2. 1
    1
      Marlin/src/HAL/AVR/MarlinSerial.h
  3. 1
    1
      Marlin/src/core/serial_base.h

+ 2
- 3
Marlin/src/HAL/AVR/MarlinSerial.cpp 查看文件

454
 }
454
 }
455
 
455
 
456
 template<typename Cfg>
456
 template<typename Cfg>
457
-size_t MarlinSerial<Cfg>::write(const uint8_t c) {
457
+void MarlinSerial<Cfg>::write(const uint8_t c) {
458
   if (Cfg::TX_SIZE == 0) {
458
   if (Cfg::TX_SIZE == 0) {
459
 
459
 
460
     _written = true;
460
     _written = true;
480
       // location". This makes sure flush() won't return until the bytes
480
       // location". This makes sure flush() won't return until the bytes
481
       // actually got written
481
       // actually got written
482
       B_TXC = 1;
482
       B_TXC = 1;
483
-      return 1;
483
+      return;
484
     }
484
     }
485
 
485
 
486
     const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1);
486
     const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1);
510
     // Enable TX ISR - Non atomic, but it will eventually enable TX ISR
510
     // Enable TX ISR - Non atomic, but it will eventually enable TX ISR
511
     B_UDRIE = 1;
511
     B_UDRIE = 1;
512
   }
512
   }
513
-  return 1;
514
 }
513
 }
515
 
514
 
516
 template<typename Cfg>
515
 template<typename Cfg>

+ 1
- 1
Marlin/src/HAL/AVR/MarlinSerial.h 查看文件

210
     static int read();
210
     static int read();
211
     static void flush();
211
     static void flush();
212
     static ring_buffer_pos_t available();
212
     static ring_buffer_pos_t available();
213
-    static size_t write(const uint8_t c);
213
+    static void write(const uint8_t c);
214
     static void flushTX();
214
     static void flushTX();
215
     #if HAS_DGUS_LCD
215
     #if HAS_DGUS_LCD
216
       static ring_buffer_pos_t get_tx_buffer_free();
216
       static ring_buffer_pos_t get_tx_buffer_free();

+ 1
- 1
Marlin/src/core/serial_base.h 查看文件

100
 
100
 
101
   // Static dispatch methods below:
101
   // Static dispatch methods below:
102
   // The most important method here is where it all ends to:
102
   // The most important method here is where it all ends to:
103
-  size_t write(uint8_t c)           { return SerialChild->write(c); }
103
+  void write(uint8_t c)             { SerialChild->write(c); }
104
 
104
 
105
   // Called when the parser finished processing an instruction, usually build to nothing
105
   // Called when the parser finished processing an instruction, usually build to nothing
106
   void msgDone() const              { SerialChild->msgDone(); }
106
   void msgDone() const              { SerialChild->msgDone(); }

正在加载...
取消
保存