InsanityAutomation пре 5 година
родитељ
комит
5eeffab5e5

+ 1
- 0
Marlin/src/feature/bltouch.cpp Прегледај датотеку

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

+ 3
- 1
Marlin/src/feature/bltouch.h Прегледај датотеку

@@ -44,13 +44,15 @@ public:
44 44
   FORCE_INLINE static void set_5V_mode() { command(BLTOUCH_5V_MODE); }
45 45
   FORCE_INLINE static void set_OD_mode() { command(BLTOUCH_OD_MODE); }
46 46
   FORCE_INLINE static void set_SW_mode() { command(BLTOUCH_SW_MODE); }
47
+  FORCE_INLINE static void selftest()    { command(BLTOUCH_SELFTEST); }
47 48
 
48 49
   FORCE_INLINE static bool deploy() { return set_deployed(true); }
49 50
   FORCE_INLINE static bool stow()   { return set_deployed(false); }
50 51
 
51
-private:
52 52
   FORCE_INLINE static void _deploy()     { command(BLTOUCH_DEPLOY); }
53 53
   FORCE_INLINE static void _stow()       { command(BLTOUCH_STOW); }
54
+
55
+private:
54 56
   static bool set_deployed(const bool deploy);
55 57
 };
56 58
 

+ 10
- 7
Marlin/src/lcd/menu/menu_configuration.cpp Прегледај датотеку

@@ -42,6 +42,9 @@
42 42
 
43 43
 #if HAS_BED_PROBE
44 44
   #include "../../module/probe.h"
45
+  #if ENABLED(BLTOUCH)
46
+    #include "../../feature/bltouch.h"
47
+  #endif
45 48
 #endif
46 49
 
47 50
 #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
@@ -157,14 +160,14 @@ static void lcd_factory_settings() {
157 160
   void menu_bltouch() {
158 161
     START_MENU();
159 162
     MENU_BACK(MSG_MAIN);
160
-    MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET)));
161
-    MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST)));
162
-    MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY)));
163
-    MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW)));
163
+    MENU_ITEM(function, MSG_BLTOUCH_RESET, bltouch.reset);
164
+    MENU_ITEM(function, MSG_BLTOUCH_SELFTEST, bltouch.selftest);
165
+    MENU_ITEM(function, MSG_BLTOUCH_DEPLOY, bltouch._deploy);
166
+    MENU_ITEM(function, MSG_BLTOUCH_STOW, bltouch._stow);
164 167
     #if ENABLED(BLTOUCH_V3)
165
-      MENU_ITEM(gcode, MSG_BLTOUCH_SW_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SW_MODE)));
166
-      MENU_ITEM(gcode, MSG_BLTOUCH_5V_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_5V_MODE)));
167
-      MENU_ITEM(gcode, MSG_BLTOUCH_OD_MODE, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_OD_MODE)));
168
+      MENU_ITEM(function, MSG_BLTOUCH_SW_MODE, bltouch.set_SW_mode);
169
+      MENU_ITEM(function, MSG_BLTOUCH_5V_MODE, bltouch.set_5V_mode);
170
+      MENU_ITEM(function, MSG_BLTOUCH_OD_MODE, bltouch.set_OD_mode);
168 171
     #endif
169 172
     END_MENU();
170 173
   }

Loading…
Откажи
Сачувај