Procházet zdrojové kódy

Use PGM serial strings

Scott Lahteine před 4 roky
rodič
revize
21ce39aa9b

+ 5
- 10
Marlin/src/feature/runout.cpp Zobrazit soubor

@@ -40,8 +40,9 @@ bool FilamentMonitorBase::enabled = true,
40 40
 #endif
41 41
 
42 42
 #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
43
-  //#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
44 43
   #include "../module/tool_change.h"
44
+  #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
45
+  #include "../core/debug_out.h"
45 46
 #endif
46 47
 
47 48
 #if HAS_FILAMENT_RUNOUT_DISTANCE
@@ -74,15 +75,11 @@ void event_filament_runout() {
74 75
 
75 76
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
76 77
     if (migration.in_progress) {
77
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
78
-        SERIAL_ECHOLN("Migration Already In Progress");
79
-      #endif
78
+      DEBUG_ECHOLNPGM("Migration Already In Progress");
80 79
       return;  // Action already in progress. Purge triggered repeated runout.
81 80
     }
82 81
     if (migration.automode) {
83
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
84
-        SERIAL_ECHOLN("Migration Starting");
85
-      #endif
82
+      DEBUG_ECHOLNPGM("Migration Starting");
86 83
       if (extruder_migration()) return;
87 84
     }
88 85
   #endif
@@ -109,9 +106,7 @@ void event_filament_runout() {
109 106
     if (run_runout_script
110 107
       && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
111 108
         || strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
112
-        #if ENABLED(ADVANCED_PAUSE_FEATURE)
113
-          || strstr(FILAMENT_RUNOUT_SCRIPT, "M25")
114
-        #endif
109
+        || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
115 110
       )
116 111
     ) {
117 112
       host_action_paused(false);

+ 2
- 2
Marlin/src/gcode/gcode.cpp Zobrazit soubor

@@ -754,8 +754,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
754 754
           case 511: M511(); break;                                // M511: Unlock Printer
755 755
         #endif
756 756
         #if ENABLED(PASSWORD_CHANGE_GCODE)
757
-          case 512: M512(); break;
758
-        #endif                                                    // M512: Set/Change/Remove Password
757
+          case 512: M512(); break;                                // M512: Set/Change/Remove Password
758
+        #endif
759 759
       #endif
760 760
 
761 761
       #if ENABLED(SDSUPPORT)

+ 1
- 1
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp Zobrazit soubor

@@ -294,7 +294,7 @@ namespace Anycubic {
294 294
   void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) {
295 295
     if (str != nullptr) {
296 296
       #if ACDEBUG(AC_SOME)
297
-        SERIAL_ECHO("> ");
297
+        SERIAL_ECHOPGM("> ");
298 298
       #endif
299 299
       SendtoTFT(str);
300 300
       #if ACDEBUG(AC_SOME)

+ 2
- 2
Marlin/src/lcd/tft/touch.cpp Zobrazit soubor

@@ -189,12 +189,12 @@ void Touch::touch(touch_control_t *control) {
189 189
             }
190 190
 
191 191
             if (calibration_state == CALIBRATION_SUCCESS) {
192
-              SERIAL_ECHOLN("Touch screen calibration completed");
192
+              SERIAL_ECHOLNPGM("Touch screen calibration completed");
193 193
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
194 194
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
195 195
               SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
196 196
               SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
197
-              SERIAL_ECHO("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLN("TOUCH_LANDSCAPE"); else SERIAL_ECHOLN("TOUCH_PORTRAIT");
197
+              SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT");
198 198
             }
199 199
             break;
200 200
           default: break;

+ 10
- 21
Marlin/src/module/tool_change.cpp Zobrazit soubor

@@ -1209,25 +1209,22 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1209 1209
 
1210 1210
 #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
1211 1211
 
1212
+  #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1213
+  #include "../core/debug_out.h"
1214
+
1212 1215
   bool extruder_migration() {
1213 1216
 
1214 1217
     #if ENABLED(PREVENT_COLD_EXTRUSION)
1215 1218
       if (thermalManager.targetTooColdToExtrude(active_extruder)) {
1216
-        #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1217
-          SERIAL_ECHOLN("Migration Source Too Cold");
1218
-        #endif
1219
+        DEBUG_ECHOLNPGM("Migration Source Too Cold");
1219 1220
         return false;
1220 1221
       }
1221 1222
     #endif
1222 1223
 
1223 1224
     // No auto-migration or specified target?
1224 1225
     if (!migration.target && active_extruder >= migration.last) {
1225
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1226
-        SERIAL_ECHO_MSG("No Migration Target");
1227
-        SERIAL_ECHO_MSG("Target: ", migration.target,
1228
-                        " Last: ", migration.last,
1229
-                        " Active: ", active_extruder);
1230
-      #endif
1226
+      DEBUG_ECHO_MSG("No Migration Target");
1227
+      DEBUG_ECHO_MSG("Target: ", migration.target, " Last: ", migration.last, " Active: ", active_extruder);
1231 1228
       migration.automode = false;
1232 1229
       return false;
1233 1230
     }
@@ -1237,9 +1234,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1237 1234
     uint8_t migration_extruder = active_extruder;
1238 1235
 
1239 1236
     if (migration.target) {
1240
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1241
-        SERIAL_ECHOLN("Migration using fixed target");
1242
-      #endif
1237
+      DEBUG_ECHOLNPGM("Migration using fixed target");
1243 1238
       // Specified target ok?
1244 1239
       const int16_t t = migration.target - 1;
1245 1240
       if (t != active_extruder) migration_extruder = t;
@@ -1248,16 +1243,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1248 1243
       migration_extruder++;
1249 1244
 
1250 1245
     if (migration_extruder == active_extruder) {
1251
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1252
-        SERIAL_ECHOLN("Migration source matches active");
1253
-      #endif
1246
+      DEBUG_ECHOLNPGM("Migration source matches active");
1254 1247
       return false;
1255 1248
     }
1256 1249
 
1257 1250
     // Migration begins
1258
-    #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1259
-      SERIAL_ECHOLN("Beginning migration");
1260
-    #endif
1251
+    DEBUG_ECHOLNPGM("Beginning migration");
1261 1252
 
1262 1253
     migration.in_progress = true; // Prevent runout script
1263 1254
     planner.synchronize();
@@ -1303,9 +1294,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1303 1294
 
1304 1295
     planner.synchronize();
1305 1296
     planner.set_e_position_mm(current_position.e); // New extruder primed and ready
1306
-    #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
1307
-      SERIAL_ECHOLN("Migration Complete");
1308
-    #endif
1297
+    DEBUG_ECHOLNPGM("Migration Complete");
1309 1298
     return true;
1310 1299
   }
1311 1300
 

+ 2
- 0
Marlin/src/module/tool_change.h Zobrazit soubor

@@ -24,6 +24,8 @@
24 24
 #include "../inc/MarlinConfigPre.h"
25 25
 #include "../core/types.h"
26 26
 
27
+//#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
28
+
27 29
 #if HAS_MULTI_EXTRUDER
28 30
 
29 31
   typedef struct {

Loading…
Zrušit
Uložit