Fix BLTouch Menus (#13441)

This commit is contained in:
InsanityAutomation 2019-03-23 23:58:34 -04:00 committed by Scott Lahteine
parent d8329d858d
commit 5eeffab5e5
3 changed files with 14 additions and 8 deletions

View file

@ -36,6 +36,7 @@ void stop();
#include "../core/debug_out.h" #include "../core/debug_out.h"
void BLTouch::command(const BLTCommand cmd) { void BLTouch::command(const BLTCommand cmd) {
//SERIAL_ECHOLNPAIR("BLTouch Command :", cmd);
MOVE_SERVO(Z_PROBE_SERVO_NR, cmd); MOVE_SERVO(Z_PROBE_SERVO_NR, cmd);
safe_delay(BLTOUCH_DELAY); safe_delay(BLTOUCH_DELAY);
} }

View file

@ -44,13 +44,15 @@ public:
FORCE_INLINE static void set_5V_mode() { command(BLTOUCH_5V_MODE); } FORCE_INLINE static void set_5V_mode() { command(BLTOUCH_5V_MODE); }
FORCE_INLINE static void set_OD_mode() { command(BLTOUCH_OD_MODE); } FORCE_INLINE static void set_OD_mode() { command(BLTOUCH_OD_MODE); }
FORCE_INLINE static void set_SW_mode() { command(BLTOUCH_SW_MODE); } FORCE_INLINE static void set_SW_mode() { command(BLTOUCH_SW_MODE); }
FORCE_INLINE static void selftest() { command(BLTOUCH_SELFTEST); }
FORCE_INLINE static bool deploy() { return set_deployed(true); } FORCE_INLINE static bool deploy() { return set_deployed(true); }
FORCE_INLINE static bool stow() { return set_deployed(false); } FORCE_INLINE static bool stow() { return set_deployed(false); }
private:
FORCE_INLINE static void _deploy() { command(BLTOUCH_DEPLOY); } FORCE_INLINE static void _deploy() { command(BLTOUCH_DEPLOY); }
FORCE_INLINE static void _stow() { command(BLTOUCH_STOW); } FORCE_INLINE static void _stow() { command(BLTOUCH_STOW); }
private:
static bool set_deployed(const bool deploy); static bool set_deployed(const bool deploy);
}; };

View file

@ -42,6 +42,9 @@
#if HAS_BED_PROBE #if HAS_BED_PROBE
#include "../../module/probe.h" #include "../../module/probe.h"
#if ENABLED(BLTOUCH)
#include "../../feature/bltouch.h"
#endif
#endif #endif
#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
@ -157,14 +160,14 @@ static void lcd_factory_settings() {
void menu_bltouch() { void menu_bltouch() {
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); MENU_ITEM(function, MSG_BLTOUCH_RESET, bltouch.reset);
MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); MENU_ITEM(function, MSG_BLTOUCH_SELFTEST, bltouch.selftest);
MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); MENU_ITEM(function, MSG_BLTOUCH_DEPLOY, bltouch._deploy);
MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); MENU_ITEM(function, MSG_BLTOUCH_STOW, bltouch._stow);
#if ENABLED(BLTOUCH_V3) #if ENABLED(BLTOUCH_V3)
MENU_ITEM(gcode, MSG_BLTOUCH_SW_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SW_MODE))); MENU_ITEM(function, MSG_BLTOUCH_SW_MODE, bltouch.set_SW_mode);
MENU_ITEM(gcode, MSG_BLTOUCH_5V_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_5V_MODE))); MENU_ITEM(function, MSG_BLTOUCH_5V_MODE, bltouch.set_5V_mode);
MENU_ITEM(gcode, MSG_BLTOUCH_OD_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_OD_MODE))); MENU_ITEM(function, MSG_BLTOUCH_OD_MODE, bltouch.set_OD_mode);
#endif #endif
END_MENU(); END_MENU();
} }