Browse Source

Add Z_PROBE_END_SCRIPT to UBL (#14419)

InsanityAutomation 5 years ago
parent
commit
b961251899
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 12
- 0
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

306
 
306
 
307
   void unified_bed_leveling::G29() {
307
   void unified_bed_leveling::G29() {
308
 
308
 
309
+    bool probe_deployed = false;
309
     if (g29_parameter_parsing()) return; // Abort on parameter error
310
     if (g29_parameter_parsing()) return; // Abort on parameter error
310
 
311
 
311
     const int8_t p_val = parser.intval('P', -1);
312
     const int8_t p_val = parser.intval('P', -1);
418
         }
419
         }
419
         do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)));
420
         do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)));
420
         report_current_position();
421
         report_current_position();
422
+        probe_deployed = true;
421
       }
423
       }
422
 
424
 
423
     #endif // HAS_BED_PROBE
425
     #endif // HAS_BED_PROBE
457
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
459
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
458
 
460
 
459
             report_current_position();
461
             report_current_position();
462
+            probe_deployed = true;
460
             break;
463
             break;
461
 
464
 
462
         #endif // HAS_BED_PROBE
465
         #endif // HAS_BED_PROBE
492
                 SERIAL_ECHOLNPGM("?Error in Business Card measurement.");
495
                 SERIAL_ECHOLNPGM("?Error in Business Card measurement.");
493
                 return;
496
                 return;
494
               }
497
               }
498
+              probe_deployed = true;
495
             }
499
             }
496
 
500
 
497
             if (!position_is_reachable(g29_x_pos, g29_y_pos)) {
501
             if (!position_is_reachable(g29_x_pos, g29_y_pos)) {
671
       ui.release();
675
       ui.release();
672
     #endif
676
     #endif
673
 
677
 
678
+    #ifdef Z_PROBE_END_SCRIPT
679
+      if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
680
+      if (probe_deployed) {
681
+        planner.synchronize();
682
+        process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT));
683
+      }
684
+    #endif
685
+
674
     return;
686
     return;
675
   }
687
   }
676
 
688
 

Loading…
Cancel
Save