Browse Source

Add handling of BLTouch error state

Scott Lahteine 8 years ago
parent
commit
f38a33a5d8
4 changed files with 28 additions and 0 deletions
  1. 5
    0
      Marlin/Marlin_main.cpp
  2. 9
    0
      Marlin/enum.h
  3. 3
    0
      Marlin/language_en.h
  4. 11
    0
      Marlin/ultralcd.cpp

+ 5
- 0
Marlin/Marlin_main.cpp View File

@@ -1881,6 +1881,11 @@ static void clean_up_after_endstop_or_probe_move() {
1881 1881
     // Make room for probe
1882 1882
     do_probe_raise(_Z_PROBE_DEPLOY_HEIGHT);
1883 1883
 
1884
+    // Check BLTOUCH probe status for an error
1885
+    #if ENABLED(BLTOUCH)
1886
+      if (servo[Z_ENDSTOP_SERVO_NR].read() == BLTouchState_Error) { stop(); return true; }
1887
+    #endif
1888
+
1884 1889
     #if ENABLED(Z_PROBE_SLED)
1885 1890
       if (axis_unhomed_error(true, false, false)) { stop(); return true; }
1886 1891
     #elif ENABLED(Z_PROBE_ALLEN_KEY)

+ 9
- 0
Marlin/enum.h View File

@@ -124,6 +124,15 @@ enum TempState {
124 124
   };
125 125
 #endif
126 126
 
127
+#if ENABLED(BLTOUCH)
128
+  enum BLTouchState {
129
+    BLTouchState_Deploy   = 10,
130
+    BLTouchState_Stow     = 90,
131
+    BLTouchState_Selftest = 120,
132
+    BLTouchState_Error    = 160
133
+  };
134
+#endif
135
+
127 136
 #if ENABLED(FILAMENT_CHANGE_FEATURE)
128 137
   enum FilamentChangeMenuResponse {
129 138
     FILAMENT_CHANGE_RESPONSE_WAIT_FOR,

+ 3
- 0
Marlin/language_en.h View File

@@ -366,6 +366,9 @@
366 366
 #ifndef MSG_ZPROBE_OUT
367 367
   #define MSG_ZPROBE_OUT                      "Z probe out. bed"
368 368
 #endif
369
+#ifndef MSG_RESET_BLTOUCH
370
+  #define MSG_RESET_BLTOUCH                   "Reset BLTouch"
371
+#endif
369 372
 #ifndef MSG_HOME
370 373
   #define MSG_HOME                            "Home"  // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
371 374
 #endif

+ 11
- 0
Marlin/ultralcd.cpp View File

@@ -30,6 +30,11 @@
30 30
 #include "configuration_store.h"
31 31
 #include "utility.h"
32 32
 
33
+#if ENABLED(BLTOUCH)
34
+  #include "servo.h"
35
+  extern Servo servo[NUM_SERVOS];
36
+#endif
37
+
33 38
 #if ENABLED(PRINTCOUNTER)
34 39
   #include "printcounter.h"
35 40
   #include "duration_t.h"
@@ -586,6 +591,12 @@ void kill_screen(const char* lcd_msg) {
586 591
   static void lcd_main_menu() {
587 592
     START_MENU();
588 593
     MENU_ITEM(back, MSG_WATCH);
594
+
595
+    #if ENABLED(BLTOUCH)
596
+      if (servo[Z_ENDSTOP_SERVO_NR].read() == BLTouchState_Error)
597
+        MENU_ITEM(gcode, MSG_RESET_BLTOUCH, "M280 S90 P" STRINGIFY(Z_ENDSTOP_SERVO_NR));
598
+    #endif
599
+
589 600
     if (planner.movesplanned() || IS_SD_PRINTING) {
590 601
       MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
591 602
     }

Loading…
Cancel
Save