diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0a4e9b8fbf..1f86f88dcc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1881,6 +1881,11 @@ static void clean_up_after_endstop_or_probe_move() { // Make room for probe do_probe_raise(_Z_PROBE_DEPLOY_HEIGHT); + // Check BLTOUCH probe status for an error + #if ENABLED(BLTOUCH) + if (servo[Z_ENDSTOP_SERVO_NR].read() == BLTouchState_Error) { stop(); return true; } + #endif + #if ENABLED(Z_PROBE_SLED) if (axis_unhomed_error(true, false, false)) { stop(); return true; } #elif ENABLED(Z_PROBE_ALLEN_KEY) diff --git a/Marlin/enum.h b/Marlin/enum.h index 18db5a6f5f..34e02234a8 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -124,6 +124,15 @@ enum TempState { }; #endif +#if ENABLED(BLTOUCH) + enum BLTouchState { + BLTouchState_Deploy = 10, + BLTouchState_Stow = 90, + BLTouchState_Selftest = 120, + BLTouchState_Error = 160 + }; +#endif + #if ENABLED(FILAMENT_CHANGE_FEATURE) enum FilamentChangeMenuResponse { FILAMENT_CHANGE_RESPONSE_WAIT_FOR, diff --git a/Marlin/language_en.h b/Marlin/language_en.h index b1b8e0af75..a84d1acfdb 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -366,6 +366,9 @@ #ifndef MSG_ZPROBE_OUT #define MSG_ZPROBE_OUT "Z probe out. bed" #endif +#ifndef MSG_RESET_BLTOUCH + #define MSG_RESET_BLTOUCH "Reset BLTouch" +#endif #ifndef MSG_HOME #define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a1deff0326..5240c30fab 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -30,6 +30,11 @@ #include "configuration_store.h" #include "utility.h" +#if ENABLED(BLTOUCH) + #include "servo.h" + extern Servo servo[NUM_SERVOS]; +#endif + #if ENABLED(PRINTCOUNTER) #include "printcounter.h" #include "duration_t.h" @@ -586,6 +591,12 @@ void kill_screen(const char* lcd_msg) { static void lcd_main_menu() { START_MENU(); MENU_ITEM(back, MSG_WATCH); + + #if ENABLED(BLTOUCH) + if (servo[Z_ENDSTOP_SERVO_NR].read() == BLTouchState_Error) + MENU_ITEM(gcode, MSG_RESET_BLTOUCH, "M280 S90 P" STRINGIFY(Z_ENDSTOP_SERVO_NR)); + #endif + if (planner.movesplanned() || IS_SD_PRINTING) { MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); }