ソースを参照

Followup to serial reform

Reference #13250
Scott Lahteine 5年前
コミット
64253e1a58

+ 5
- 6
Marlin/src/core/serial.h ファイルの表示

@@ -42,18 +42,14 @@ enum MarlinDebugFlags : uint8_t {
42 42
 extern uint8_t marlin_debug_flags;
43 43
 #define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F))
44 44
 
45
-#if TX_BUFFER_SIZE < 1
46
-  #define SERIAL_FLUSHTX()
47
-#endif
48
-
49 45
 #if NUM_SERIAL > 1
50 46
   extern int8_t serial_port_index;
51 47
   #define _PORT_REDIRECT(n,p)   REMEMBER(n,serial_port_index,p)
52 48
   #define _PORT_RESTORE(n)      RESTORE(n)
53 49
   #define SERIAL_BOTH 0x7F
54 50
   #define SERIAL_OUT(WHAT, ...) do{ \
55
-    if (!serial_port_index || serial_port_index == SERIAL_BOTH) MYSERIAL0.WHAT(##__VA_ARGS__); \
56
-    if ( serial_port_index) MYSERIAL1.WHAT(##__VA_ARGS__); \
51
+    if (!serial_port_index || serial_port_index == SERIAL_BOTH) MYSERIAL0.WHAT(__VA_ARGS__); \
52
+    if ( serial_port_index) MYSERIAL1.WHAT(__VA_ARGS__); \
57 53
   }while(0)
58 54
 #else
59 55
   #define _PORT_REDIRECT(n,p)   NOOP
@@ -72,8 +68,11 @@ extern uint8_t marlin_debug_flags;
72 68
 #define SERIAL_PRINTLN(x,b)     SERIAL_OUT(println, x, b)
73 69
 #define SERIAL_PRINTF(args...)  SERIAL_OUT(printf, args)
74 70
 #define SERIAL_FLUSH()          SERIAL_OUT(flush)
71
+
75 72
 #if TX_BUFFER_SIZE > 0
76 73
   #define SERIAL_FLUSHTX()      SERIAL_OUT(flushTX)
74
+#else
75
+  #define SERIAL_FLUSHTX()
77 76
 #endif
78 77
 
79 78
 #define SERIAL_ECHOPGM(x)                   (serialprintPGM(PSTR(x)))

+ 4
- 24
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp ファイルの表示

@@ -51,11 +51,7 @@
51 51
  */
52 52
 void GcodeSuite::M20() {
53 53
   SERIAL_ECHOLNPGM(MSG_BEGIN_FILE_LIST);
54
-  card.ls(
55
-    #if NUM_SERIAL > 1
56
-      command_queue_port[cmd_queue_index_r]
57
-    #endif
58
-  );
54
+  card.ls();
59 55
   SERIAL_ECHOLNPGM(MSG_END_FILE_LIST);
60 56
 }
61 57
 
@@ -160,10 +156,6 @@ void GcodeSuite::M26() {
160 156
  *      OR, with 'C' get the current filename.
161 157
  */
162 158
 void GcodeSuite::M27() {
163
-  #if NUM_SERIAL > 1
164
-    const int16_t port = serial_port_index;
165
-  #endif
166
-
167 159
   if (parser.seen('C')) {
168 160
     SERIAL_ECHOPGM("Current file: ");
169 161
     card.printFilename();
@@ -171,19 +163,11 @@ void GcodeSuite::M27() {
171 163
 
172 164
   #if ENABLED(AUTO_REPORT_SD_STATUS)
173 165
     else if (parser.seenval('S'))
174
-      card.set_auto_report_interval(parser.value_byte()
175
-        #if NUM_SERIAL > 1
176
-          , port
177
-        #endif
178
-      );
166
+      card.set_auto_report_interval(parser.value_byte());
179 167
   #endif
180 168
 
181 169
   else
182
-    card.report_status(
183
-      #if NUM_SERIAL > 1
184
-        port
185
-      #endif
186
-    );
170
+    card.report_status();
187 171
 }
188 172
 
189 173
 /**
@@ -281,11 +265,7 @@ void GcodeSuite::M32() {
281 265
    *   /Miscellaneous/Armchair/Armchair.gcode
282 266
    */
283 267
   void GcodeSuite::M33() {
284
-    card.printLongPath(parser.string_arg
285
-      #if NUM_SERIAL > 1
286
-        , command_queue_port[cmd_queue_index_r]
287
-      #endif
288
-    );
268
+    card.printLongPath(parser.string_arg);
289 269
   }
290 270
 
291 271
 #endif // LONG_FILENAME_HOST_SUPPORT

+ 0
- 3
Marlin/src/gcode/stats/M31.cpp ファイルの表示

@@ -34,9 +34,6 @@
34 34
  * M31: Get the time since the start of SD Print (or last M109)
35 35
  */
36 36
 void GcodeSuite::M31() {
37
-  #if NUM_SERIAL > 1
38
-    const int16_t port = command_queue_port[cmd_queue_index_r];
39
-  #endif
40 37
   char buffer[21];
41 38
   duration_t elapsed = print_job_timer.duration();
42 39
   elapsed.toString(buffer);

+ 1
- 9
Marlin/src/gcode/temperature/M105.cpp ファイルの表示

@@ -35,17 +35,9 @@ void GcodeSuite::M105() {
35 35
   const int8_t target_extruder = get_target_extruder_from_command();
36 36
   if (target_extruder < 0) return;
37 37
 
38
-  #if NUM_SERIAL > 1
39
-    const int16_t port = command_queue_port[cmd_queue_index_r];
40
-  #endif
41
-
42 38
   #if HAS_TEMP_SENSOR
43 39
     SERIAL_ECHOPGM(MSG_OK);
44
-    thermalManager.print_heater_states(target_extruder
45
-      #if NUM_SERIAL > 1
46
-        , port
47
-      #endif
48
-    );
40
+    thermalManager.print_heater_states(target_extruder);
49 41
   #else // !HAS_TEMP_SENSOR
50 42
     SERIAL_ERROR_MSG(MSG_ERR_NO_THERMISTORS);
51 43
   #endif

+ 0
- 9
Marlin/src/module/temperature.cpp ファイルの表示

@@ -2537,9 +2537,6 @@ void Temperature::isr() {
2537 2537
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
2538 2538
           , rawHotendTemp(target_extruder)
2539 2539
         #endif
2540
-        #if NUM_SERIAL > 1
2541
-          , port
2542
-        #endif
2543 2540
       );
2544 2541
     #endif
2545 2542
     #if HAS_HEATED_BED
@@ -2547,9 +2544,6 @@ void Temperature::isr() {
2547 2544
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
2548 2545
           , rawBedTemp()
2549 2546
         #endif
2550
-        #if NUM_SERIAL > 1
2551
-          , port
2552
-        #endif
2553 2547
         , -1 // BED
2554 2548
       );
2555 2549
     #endif
@@ -2566,9 +2560,6 @@ void Temperature::isr() {
2566 2560
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
2567 2561
           , rawHotendTemp(e)
2568 2562
         #endif
2569
-        #if NUM_SERIAL > 1
2570
-          , port
2571
-        #endif
2572 2563
         , e
2573 2564
       );
2574 2565
     #endif

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