Browse Source

Merge pull request #2221 from MagoKimbra/Dryrun

Insert Debug DRYRUN Repetier Host compatible
AnHardt 10 years ago
parent
commit
e400fce271
3 changed files with 26 additions and 2 deletions
  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 View File

3351
  */
3351
  */
3352
 inline void gcode_M104() {
3352
 inline void gcode_M104() {
3353
   if (setTargetedHotend(104)) return;
3353
   if (setTargetedHotend(104)) return;
3354
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3354
 
3355
 
3355
   if (code_seen('S')) {
3356
   if (code_seen('S')) {
3356
     float temp = code_value();
3357
     float temp = code_value();
3450
  */
3451
  */
3451
 inline void gcode_M109() {
3452
 inline void gcode_M109() {
3452
   if (setTargetedHotend(109)) return;
3453
   if (setTargetedHotend(109)) return;
3454
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3453
 
3455
 
3454
   LCD_MESSAGEPGM(MSG_HEATING);
3456
   LCD_MESSAGEPGM(MSG_HEATING);
3455
 
3457
 
3534
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
3536
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
3535
    */
3537
    */
3536
   inline void gcode_M190() {
3538
   inline void gcode_M190() {
3539
+    if (marlin_debug_flags & DEBUG_DRYRUN) return;
3540
+
3537
     LCD_MESSAGEPGM(MSG_BED_HEATING);
3541
     LCD_MESSAGEPGM(MSG_BED_HEATING);
3538
     no_wait_for_cooling = code_seen('S');
3542
     no_wait_for_cooling = code_seen('S');
3539
     if (no_wait_for_cooling || code_seen('R'))
3543
     if (no_wait_for_cooling || code_seen('R'))
3569
  * M111: Set the debug level
3573
  * M111: Set the debug level
3570
  */
3574
  */
3571
 inline void gcode_M111() {
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
  * M140: Set bed temperature
3624
  * M140: Set bed temperature
3608
  */
3625
  */
3609
 inline void gcode_M140() {
3626
 inline void gcode_M140() {
3627
+  if (marlin_debug_flags & DEBUG_DRYRUN) return;
3610
   if (code_seen('S')) setTargetBed(code_value());
3628
   if (code_seen('S')) setTargetBed(code_value());
3611
 }
3629
 }
3612
 
3630
 
5910
 #ifdef PREVENT_DANGEROUS_EXTRUDE
5928
 #ifdef PREVENT_DANGEROUS_EXTRUDE
5911
 
5929
 
5912
   inline void prevent_dangerous_extrude(float &curr_e, float &dest_e) {
5930
   inline void prevent_dangerous_extrude(float &curr_e, float &dest_e) {
5931
+    if (marlin_debug_flags & DEBUG_DRYRUN) return;
5913
     float de = dest_e - curr_e;
5932
     float de = dest_e - curr_e;
5914
     if (de) {
5933
     if (de) {
5915
       if (degHotend(active_extruder) < extrude_min_temp) {
5934
       if (degHotend(active_extruder) < extrude_min_temp) {

+ 5
- 0
Marlin/language.h View File

215
 #define MSG_T_MAXTEMP                       "MAXTEMP triggered"
215
 #define MSG_T_MAXTEMP                       "MAXTEMP triggered"
216
 #define MSG_T_MINTEMP                       "MINTEMP triggered"
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
 // LCD Menu Messages
224
 // LCD Menu Messages
220
 
225
 

+ 1
- 1
Marlin/planner.cpp View File

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

Loading…
Cancel
Save