Browse Source

Use PGM serial strings

Scott Lahteine 4 years ago
parent
commit
21ce39aa9b

+ 5
- 10
Marlin/src/feature/runout.cpp View File

40
 #endif
40
 #endif
41
 
41
 
42
 #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
42
 #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
43
-  //#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
44
   #include "../module/tool_change.h"
43
   #include "../module/tool_change.h"
44
+  #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
45
+  #include "../core/debug_out.h"
45
 #endif
46
 #endif
46
 
47
 
47
 #if HAS_FILAMENT_RUNOUT_DISTANCE
48
 #if HAS_FILAMENT_RUNOUT_DISTANCE
74
 
75
 
75
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
76
   #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
76
     if (migration.in_progress) {
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
       return;  // Action already in progress. Purge triggered repeated runout.
79
       return;  // Action already in progress. Purge triggered repeated runout.
81
     }
80
     }
82
     if (migration.automode) {
81
     if (migration.automode) {
83
-      #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
84
-        SERIAL_ECHOLN("Migration Starting");
85
-      #endif
82
+      DEBUG_ECHOLNPGM("Migration Starting");
86
       if (extruder_migration()) return;
83
       if (extruder_migration()) return;
87
     }
84
     }
88
   #endif
85
   #endif
109
     if (run_runout_script
106
     if (run_runout_script
110
       && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
107
       && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
111
         || strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
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
       host_action_paused(false);
112
       host_action_paused(false);

+ 2
- 2
Marlin/src/gcode/gcode.cpp View File

754
           case 511: M511(); break;                                // M511: Unlock Printer
754
           case 511: M511(); break;                                // M511: Unlock Printer
755
         #endif
755
         #endif
756
         #if ENABLED(PASSWORD_CHANGE_GCODE)
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
       #endif
759
       #endif
760
 
760
 
761
       #if ENABLED(SDSUPPORT)
761
       #if ENABLED(SDSUPPORT)

+ 1
- 1
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp View File

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

+ 2
- 2
Marlin/src/lcd/tft/touch.cpp View File

189
             }
189
             }
190
 
190
 
191
             if (calibration_state == CALIBRATION_SUCCESS) {
191
             if (calibration_state == CALIBRATION_SUCCESS) {
192
-              SERIAL_ECHOLN("Touch screen calibration completed");
192
+              SERIAL_ECHOLNPGM("Touch screen calibration completed");
193
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
193
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
194
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
194
               SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
195
               SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
195
               SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
196
               SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
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
             break;
199
             break;
200
           default: break;
200
           default: break;

+ 10
- 21
Marlin/src/module/tool_change.cpp View File

1209
 
1209
 
1210
 #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
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
   bool extruder_migration() {
1215
   bool extruder_migration() {
1213
 
1216
 
1214
     #if ENABLED(PREVENT_COLD_EXTRUSION)
1217
     #if ENABLED(PREVENT_COLD_EXTRUSION)
1215
       if (thermalManager.targetTooColdToExtrude(active_extruder)) {
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
         return false;
1220
         return false;
1220
       }
1221
       }
1221
     #endif
1222
     #endif
1222
 
1223
 
1223
     // No auto-migration or specified target?
1224
     // No auto-migration or specified target?
1224
     if (!migration.target && active_extruder >= migration.last) {
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
       migration.automode = false;
1228
       migration.automode = false;
1232
       return false;
1229
       return false;
1233
     }
1230
     }
1237
     uint8_t migration_extruder = active_extruder;
1234
     uint8_t migration_extruder = active_extruder;
1238
 
1235
 
1239
     if (migration.target) {
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
       // Specified target ok?
1238
       // Specified target ok?
1244
       const int16_t t = migration.target - 1;
1239
       const int16_t t = migration.target - 1;
1245
       if (t != active_extruder) migration_extruder = t;
1240
       if (t != active_extruder) migration_extruder = t;
1248
       migration_extruder++;
1243
       migration_extruder++;
1249
 
1244
 
1250
     if (migration_extruder == active_extruder) {
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
       return false;
1247
       return false;
1255
     }
1248
     }
1256
 
1249
 
1257
     // Migration begins
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
     migration.in_progress = true; // Prevent runout script
1253
     migration.in_progress = true; // Prevent runout script
1263
     planner.synchronize();
1254
     planner.synchronize();
1303
 
1294
 
1304
     planner.synchronize();
1295
     planner.synchronize();
1305
     planner.set_e_position_mm(current_position.e); // New extruder primed and ready
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
     return true;
1298
     return true;
1310
   }
1299
   }
1311
 
1300
 

+ 2
- 0
Marlin/src/module/tool_change.h View File

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

Loading…
Cancel
Save