瀏覽代碼

Merge pull request #2221 from MagoKimbra/Dryrun

Insert Debug DRYRUN Repetier Host compatible
AnHardt 9 年之前
父節點
當前提交
e400fce271
共有 3 個文件被更改,包括 26 次插入2 次删除
  1. 20
    1
      Marlin/Marlin_main.cpp
  2. 5
    0
      Marlin/language.h
  3. 1
    1
      Marlin/planner.cpp

+ 20
- 1
Marlin/Marlin_main.cpp 查看文件

@@ -3351,6 +3351,7 @@ inline void gcode_M42() {
3351 3351
  */
3352 3352
 inline void gcode_M104() {
3353 3353
   if (setTargetedHotend(104)) return;
3354
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3354 3355
 
3355 3356
   if (code_seen('S')) {
3356 3357
     float temp = code_value();
@@ -3450,6 +3451,7 @@ inline void gcode_M105() {
3450 3451
  */
3451 3452
 inline void gcode_M109() {
3452 3453
   if (setTargetedHotend(109)) return;
3454
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3453 3455
 
3454 3456
   LCD_MESSAGEPGM(MSG_HEATING);
3455 3457
 
@@ -3534,6 +3536,8 @@ inline void gcode_M109() {
3534 3536
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
3535 3537
    */
3536 3538
   inline void gcode_M190() {
3539
+    if (marlin_debug_flags & DEBUG_DRYRUN) return;
3540
+
3537 3541
     LCD_MESSAGEPGM(MSG_BED_HEATING);
3538 3542
     no_wait_for_cooling = code_seen('S');
3539 3543
     if (no_wait_for_cooling || code_seen('R'))
@@ -3569,7 +3573,20 @@ inline void gcode_M109() {
3569 3573
  * M111: Set the debug level
3570 3574
  */
3571 3575
 inline void gcode_M111() {
3572
-  marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_INFO|DEBUG_ERRORS;
3576
+  marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_INFO|DEBUG_COMMUNICATION;
3577
+  
3578
+  SERIAL_ECHO_START;
3579
+  if (marlin_debug_flags & DEBUG_ECHO) SERIAL_ECHOLNPGM(MSG_DEBUG_ECHO);
3580
+  // FOR MOMENT NOT ACTIVE
3581
+  //if (marlin_debug_flags & DEBUG_INFO) SERIAL_ECHOLNPGM(MSG_DEBUG_INFO);
3582
+  //if (marlin_debug_flags & DEBUG_ERRORS) SERIAL_ECHOLNPGM(MSG_DEBUG_ERRORS);
3583
+  if (marlin_debug_flags & DEBUG_DRYRUN) {
3584
+    SERIAL_ECHOLNPGM(MSG_DEBUG_DRYRUN);
3585
+    setTargetBed(0);
3586
+    for (int8_t cur_hotend = 0; cur_hotend < EXTRUDERS; ++cur_hotend) {
3587
+      setTargetHotend(0, cur_hotend);
3588
+    }
3589
+  }
3573 3590
 }
3574 3591
 
3575 3592
 /**
@@ -3607,6 +3624,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
3607 3624
  * M140: Set bed temperature
3608 3625
  */
3609 3626
 inline void gcode_M140() {
3627
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3610 3628
   if (code_seen('S')) setTargetBed(code_value());
3611 3629
 }
3612 3630
 
@@ -5910,6 +5928,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
5910 5928
 #ifdef PREVENT_DANGEROUS_EXTRUDE
5911 5929
 
5912 5930
   inline void prevent_dangerous_extrude(float &curr_e, float &dest_e) {
5931
+    if (marlin_debug_flags & DEBUG_DRYRUN) return;
5913 5932
     float de = dest_e - curr_e;
5914 5933
     if (de) {
5915 5934
       if (degHotend(active_extruder) < extrude_min_temp) {

+ 5
- 0
Marlin/language.h 查看文件

@@ -215,6 +215,11 @@
215 215
 #define MSG_T_MAXTEMP                       "MAXTEMP triggered"
216 216
 #define MSG_T_MINTEMP                       "MINTEMP triggered"
217 217
 
218
+// Debug
219
+#define MSG_DEBUG_ECHO                      "DEBUG ECHO ENABLED"
220
+#define MSG_DEBUG_INFO                      "DEBUG INFO ENABLED"
221
+#define MSG_DEBUG_ERRORS                    "DEBUG ERRORS ENABLED"
222
+#define MSG_DEBUG_DRYRUN                    "DEBUG DRYRUN ENABLED"
218 223
 
219 224
 // LCD Menu Messages
220 225
 

+ 1
- 1
Marlin/planner.cpp 查看文件

@@ -502,7 +502,7 @@ float junction_deviation = 0.1;
502 502
 
503 503
   #ifdef PREVENT_DANGEROUS_EXTRUDE
504 504
     if (de) {
505
-      if (degHotend(extruder) < extrude_min_temp) {
505
+      if (degHotend(extruder) < extrude_min_temp && !(marlin_debug_flags & DEBUG_DRYRUN)) {
506 506
         position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
507 507
         de = 0; // no difference
508 508
         SERIAL_ECHO_START;

Loading…
取消
儲存