Browse Source

Fix BLTouch Menus (#13441)

pull/1/head
InsanityAutomation 6 years ago
committed by Scott Lahteine
parent
commit
5eeffab5e5
  1. 1
      Marlin/src/feature/bltouch.cpp
  2. 4
      Marlin/src/feature/bltouch.h
  3. 17
      Marlin/src/lcd/menu/menu_configuration.cpp

1
Marlin/src/feature/bltouch.cpp

@ -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);
} }

4
Marlin/src/feature/bltouch.h

@ -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);
}; };

17
Marlin/src/lcd/menu/menu_configuration.cpp

@ -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();
} }

Loading…
Cancel
Save