Переглянути джерело

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

Ramiro Polla 4 роки тому
джерело
коміт
8048d1411f
Аккаунт користувача з таким Email не знайдено

+ 2
- 3
Marlin/src/HAL/AVR/MarlinSerial.cpp Переглянути файл

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

+ 1
- 1
Marlin/src/HAL/AVR/MarlinSerial.h Переглянути файл

@@ -210,7 +210,7 @@
210 210
     static int read();
211 211
     static void flush();
212 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 214
     static void flushTX();
215 215
     #if HAS_DGUS_LCD
216 216
       static ring_buffer_pos_t get_tx_buffer_free();

+ 1
- 1
Marlin/src/core/serial_base.h Переглянути файл

@@ -100,7 +100,7 @@ struct SerialBase {
100 100
 
101 101
   // Static dispatch methods below:
102 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 105
   // Called when the parser finished processing an instruction, usually build to nothing
106 106
   void msgDone() const              { SerialChild->msgDone(); }

Завантаження…
Відмінити
Зберегти