소스 검색

✨ BLTouch High Speed mode runtime configuration (#22916)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 3 년 전
부모
커밋
2893048e29
No account linked to committer's email address

+ 4
- 2
Marlin/Configuration_adv.h 파일 보기

@@ -897,12 +897,14 @@
897 897
   //#define BLTOUCH_FORCE_MODE_SET
898 898
 
899 899
   /**
900
-   * Use "HIGH SPEED" mode for probing.
900
+   * Enable "HIGH SPEED" option for probing.
901 901
    * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems.
902 902
    * This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians
903 903
    * might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM.
904
+   *
905
+   * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset.
904 906
    */
905
-  //#define BLTOUCH_HS_MODE
907
+  //#define BLTOUCH_HS_MODE true
906 908
 
907 909
   // Safety: Enable voltage mode settings in the LCD menu.
908 910
   //#define BLTOUCH_LCD_VOLTAGE_MENU

+ 13
- 11
Marlin/src/feature/bltouch.cpp 파일 보기

@@ -28,7 +28,12 @@
28 28
 
29 29
 BLTouch bltouch;
30 30
 
31
-bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
31
+bool BLTouch::od_5v_mode;         // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
32
+#ifdef BLTOUCH_HS_MODE
33
+  bool BLTouch::high_speed_mode;  // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
34
+#else
35
+  constexpr bool BLTouch::high_speed_mode;
36
+#endif
32 37
 
33 38
 #include "../module/servo.h"
34 39
 #include "../module/probe.h"
@@ -64,17 +69,14 @@ void BLTouch::init(const bool set_voltage/*=false*/) {
64 69
   #else
65 70
 
66 71
     if (DEBUGGING(LEVELING)) {
67
-      DEBUG_ECHOLNPGM("last_written_mode - ", last_written_mode);
68
-      DEBUG_ECHOLNPGM("config mode - "
69
-        #if ENABLED(BLTOUCH_SET_5V_MODE)
70
-          "BLTOUCH_SET_5V_MODE"
71
-        #else
72
-          "OD"
73
-        #endif
74
-      );
72
+      PGMSTR(mode0, "OD");
73
+      PGMSTR(mode1, "5V");
74
+      DEBUG_ECHOPGM("BLTouch Mode: ");
75
+      DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
76
+      DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
75 77
     }
76 78
 
77
-    const bool should_set = last_written_mode != ENABLED(BLTOUCH_SET_5V_MODE);
79
+    const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE);
78 80
 
79 81
   #endif
80 82
 
@@ -193,7 +195,7 @@ void BLTouch::mode_conv_proc(const bool M5V) {
193 195
   _mode_store();
194 196
   if (M5V) _set_5V_mode(); else _set_OD_mode();
195 197
   _stow();
196
-  last_written_mode = M5V;
198
+  od_5v_mode = M5V;
197 199
 }
198 200
 
199 201
 #endif // BLTOUCH

+ 10
- 5
Marlin/src/feature/bltouch.h 파일 보기

@@ -23,10 +23,6 @@
23 23
 
24 24
 #include "../inc/MarlinConfigPre.h"
25 25
 
26
-#if DISABLED(BLTOUCH_HS_MODE)
27
-  #define BLTOUCH_SLOW_MODE 1
28
-#endif
29
-
30 26
 // BLTouch commands are sent as servo angles
31 27
 typedef unsigned char BLTCommand;
32 28
 
@@ -70,8 +66,17 @@ typedef unsigned char BLTCommand;
70 66
 
71 67
 class BLTouch {
72 68
 public:
69
+
73 70
   static void init(const bool set_voltage=false);
74
-  static bool last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
71
+  static bool od_5v_mode;         // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
72
+
73
+  #ifdef BLTOUCH_HS_MODE
74
+    static bool high_speed_mode;  // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
75
+  #else
76
+    static constexpr bool high_speed_mode = false;
77
+  #endif
78
+
79
+  static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; }
75 80
 
76 81
   // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
77 82
   static bool deploy()              { return deploy_proc(); }

+ 5
- 1
Marlin/src/gcode/bedlevel/G35.cpp 파일 보기

@@ -33,6 +33,10 @@
33 33
   #include "../../module/tool_change.h"
34 34
 #endif
35 35
 
36
+#if ENABLED(BLTOUCH)
37
+  #include "../../feature/bltouch.h"
38
+#endif
39
+
36 40
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
37 41
 #include "../../core/debug_out.h"
38 42
 
@@ -102,7 +106,7 @@ void GcodeSuite::G35() {
102 106
     // In BLTOUCH HS mode, the probe travels in a deployed state.
103 107
     // Users of G35 might have a badly misaligned bed, so raise Z by the
104 108
     // length of the deployed pin (BLTOUCH stroke < 7mm)
105
-    do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7));
109
+    do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()));
106 110
     const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
107 111
 
108 112
     if (isnan(z_probed_height)) {

+ 5
- 1
Marlin/src/gcode/calibrate/G34_M422.cpp 파일 보기

@@ -45,6 +45,10 @@
45 45
   #include "../../libs/least_squares_fit.h"
46 46
 #endif
47 47
 
48
+#if ENABLED(BLTOUCH)
49
+  #include "../../feature/bltouch.h"
50
+#endif
51
+
48 52
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
49 53
 #include "../../core/debug_out.h"
50 54
 
@@ -149,7 +153,7 @@ void GcodeSuite::G34() {
149 153
       // In BLTOUCH HS mode, the probe travels in a deployed state.
150 154
       // Users of G34 might have a badly misaligned bed, so raise Z by the
151 155
       // length of the deployed pin (BLTOUCH stroke < 7mm)
152
-      #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE))
156
+      #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()))
153 157
 
154 158
       // Compute a worst-case clearance height to probe from. After the first
155 159
       // iteration this will be re-calculated based on the actual bed position

+ 17
- 3
Marlin/src/gcode/probe/M401_M402.cpp 파일 보기

@@ -28,13 +28,27 @@
28 28
 #include "../../module/motion.h"
29 29
 #include "../../module/probe.h"
30 30
 
31
+#ifdef BLTOUCH_HS_MODE
32
+  #include "../../feature/bltouch.h"
33
+#endif
34
+
31 35
 /**
32 36
  * M401: Deploy and activate the Z probe
37
+ *
38
+ * With BLTOUCH_HS_MODE:
39
+ *  S<bool> Set High Speed (HS) Mode and exit without deploy
33 40
  */
34 41
 void GcodeSuite::M401() {
35
-  probe.deploy();
36
-  TERN_(PROBE_TARE, probe.tare());
37
-  report_current_position();
42
+  if (parser.seen('S')) {
43
+    #ifdef BLTOUCH_HS_MODE
44
+      bltouch.high_speed_mode = parser.value_bool();
45
+    #endif
46
+  }
47
+  else {
48
+    probe.deploy();
49
+    TERN_(PROBE_TARE, probe.tare());
50
+    report_current_position();
51
+  }
38 52
 }
39 53
 
40 54
 /**

+ 3
- 0
Marlin/src/inc/SanityCheck.h 파일 보기

@@ -1577,6 +1577,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1577 1577
       #endif
1578 1578
     #endif
1579 1579
 
1580
+    #if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0
1581
+      #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state."
1582
+    #endif
1580 1583
     #if BLTOUCH_DELAY < 200
1581 1584
       #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
1582 1585
     #endif

+ 1
- 0
Marlin/src/lcd/language/language_en.h 파일 보기

@@ -491,6 +491,7 @@ namespace Language_en {
491 491
   LSTR MSG_BLTOUCH_STOW                   = _UxGT("Stow");
492 492
   LSTR MSG_BLTOUCH_DEPLOY                 = _UxGT("Deploy");
493 493
   LSTR MSG_BLTOUCH_SW_MODE                = _UxGT("SW-Mode");
494
+  LSTR MSG_BLTOUCH_SPEED_MODE             = _UxGT("High Speed");
494 495
   LSTR MSG_BLTOUCH_5V_MODE                = _UxGT("5V-Mode");
495 496
   LSTR MSG_BLTOUCH_OD_MODE                = _UxGT("OD-Mode");
496 497
   LSTR MSG_BLTOUCH_MODE_STORE             = _UxGT("Mode-Store");

+ 12
- 9
Marlin/src/lcd/menu/menu_bed_corners.cpp 파일 보기

@@ -217,13 +217,13 @@ static void _lcd_level_bed_corners_get_next_position() {
217 217
 
218 218
   bool _lcd_level_bed_corners_probe(bool verify=false) {
219 219
     if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
220
-    TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
220
+    TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
221 221
     do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
222 222
     if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
223 223
       endstops.hit_on_purpose();
224 224
       set_current_from_steppers_for_axis(Z_AXIS);
225 225
       sync_plan_position();
226
-      TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
226
+      TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
227 227
       // Triggered outside tolerance range?
228 228
       if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
229 229
         last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
@@ -249,7 +249,7 @@ static void _lcd_level_bed_corners_get_next_position() {
249 249
       }
250 250
       idle();
251 251
     }
252
-    TERN_(BLTOUCH_SLOW_MODE, bltouch.stow());
252
+    TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow());
253 253
     ui.goto_screen(_lcd_draw_probing);
254 254
     return (probe_triggered);
255 255
   }
@@ -263,13 +263,14 @@ static void _lcd_level_bed_corners_get_next_position() {
263 263
     do {
264 264
       ui.refresh(LCDVIEW_REDRAW_NOW);
265 265
       _lcd_draw_probing();                                // update screen with # of good points
266
-      do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance
266
+
267
+      do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
267 268
 
268 269
       _lcd_level_bed_corners_get_next_position();         // Select next corner coordinates
269 270
       current_position -= probe.offset_xy;                // Account for probe offsets
270 271
       do_blocking_move_to_xy(current_position);           // Goto corner
271 272
 
272
-      TERN_(BLTOUCH_HS_MODE, bltouch.deploy());           // Deploy in HIGH SPEED MODE
273
+      TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
273 274
       if (!_lcd_level_bed_corners_probe()) {              // Probe down to tolerance
274 275
         if (_lcd_level_bed_corners_raise()) {             // Prompt user to raise bed if needed
275 276
           #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED)        // Verify
@@ -290,10 +291,12 @@ static void _lcd_level_bed_corners_get_next_position() {
290 291
 
291 292
     } while (good_points < nr_edge_points); // loop until all points within tolerance
292 293
 
293
-    #if ENABLED(BLTOUCH_HS_MODE)
294
-      // In HIGH SPEED MODE do clearance and stow at the very end
295
-      do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
296
-      bltouch.stow();
294
+    #if ENABLED(BLTOUCH)
295
+      if (bltouch.high_speed_mode)
296
+        // In HIGH SPEED MODE do clearance and stow at the very end
297
+        do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
298
+        bltouch.stow();
299
+      }
297 300
     #endif
298 301
 
299 302
     ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling

+ 10
- 4
Marlin/src/lcd/menu/menu_configuration.cpp 파일 보기

@@ -217,11 +217,14 @@ void menu_advanced_settings();
217 217
 
218 218
   #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
219 219
     void bltouch_report() {
220
-      SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
221
-      SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD"));
220
+      PGMSTR(mode0, "OD");
221
+      PGMSTR(mode1, "5V");
222
+      SERIAL_ECHOPGM("BLTouch Mode: ");
223
+      SERIAL_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
224
+      SERIAL_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
222 225
       char mess[21];
223
-      strcpy_P(mess, PSTR("BLTouch Mode - "));
224
-      strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD"));
226
+      strcpy_P(mess, PSTR("BLTouch Mode: "));
227
+      strcpy_P(&mess[15], bltouch.od_5v_mode ? mode1 : mode0);
225 228
       ui.set_status(mess);
226 229
       ui.return_to_status();
227 230
     }
@@ -235,6 +238,9 @@ void menu_advanced_settings();
235 238
     ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
236 239
     ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
237 240
     ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
241
+    #ifdef BLTOUCH_HS_MODE
242
+      EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
243
+    #endif
238 244
     #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
239 245
       CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
240 246
       CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));

+ 5
- 1
Marlin/src/lcd/menu/menu_tramming.cpp 파일 보기

@@ -36,6 +36,10 @@
36 36
 #include "../../module/probe.h"
37 37
 #include "../../gcode/queue.h"
38 38
 
39
+#if ENABLED(BLTOUCH)
40
+  #include "../../feature/bltouch.h"
41
+#endif
42
+
39 43
 //#define DEBUG_OUT 1
40 44
 #include "../../core/debug_out.h"
41 45
 
@@ -51,7 +55,7 @@ static int8_t reference_index; // = 0
51 55
 static bool probe_single_point() {
52 56
   do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
53 57
   // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
54
-  const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
58
+  const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
55 59
   z_measured[tram_index] = z_probed_height;
56 60
   if (reference_index < 0) reference_index = tram_index;
57 61
   move_to_tramming_wait_pos();

+ 5
- 4
Marlin/src/module/motion.cpp 파일 보기

@@ -1803,8 +1803,8 @@ void prepare_line_to_destination() {
1803 1803
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home Fast: ", move_length, "mm");
1804 1804
     do_homing_move(axis, move_length, 0.0, !use_probe_bump);
1805 1805
 
1806
-    #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
1807
-      if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
1806
+    #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
1807
+      if (axis == Z_AXIS && !bltouch.high_speed_mode) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
1808 1808
     #endif
1809 1809
 
1810 1810
     // If a second homing move is configured...
@@ -1837,8 +1837,9 @@ void prepare_line_to_destination() {
1837 1837
         }
1838 1838
       #endif
1839 1839
 
1840
-      #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
1841
-        if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE)
1840
+      #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
1841
+        if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy())
1842
+          return; // Intermediate DEPLOY (in LOW SPEED MODE)
1842 1843
       #endif
1843 1844
 
1844 1845
       // Slow move towards endstop until triggered

+ 11
- 6
Marlin/src/module/probe.cpp 파일 보기

@@ -489,8 +489,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
489 489
   #if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND)
490 490
     thermalManager.wait_for_hotend_heating(active_extruder);
491 491
   #endif
492
-
493
-  if (TERN0(BLTOUCH_SLOW_MODE, bltouch.deploy())) return true; // Deploy in LOW SPEED MODE on every probe action
492
+  #if ENABLED(BLTOUCH)
493
+    if (!bltouch.high_speed_mode && bltouch.deploy())
494
+      return true; // Deploy in LOW SPEED MODE on every probe action
495
+  #endif
494 496
 
495 497
   // Disable stealthChop if used. Enable diag1 pin on driver.
496 498
   #if ENABLED(SENSORLESS_PROBING)
@@ -531,8 +533,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
531 533
     set_homing_current(false);
532 534
   #endif
533 535
 
534
-  if (probe_triggered && TERN0(BLTOUCH_SLOW_MODE, bltouch.stow())) // Stow in LOW SPEED MODE on every trigger
535
-    return true;
536
+  #if ENABLED(BLTOUCH)
537
+    if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow())
538
+      return true; // Stow in LOW SPEED MODE on every trigger
539
+  #endif
536 540
 
537 541
   // Clear endstop flags
538 542
   endstops.hit_on_purpose();
@@ -762,8 +766,9 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
762 766
     DEBUG_POS("", current_position);
763 767
   }
764 768
 
765
-  #if BOTH(BLTOUCH, BLTOUCH_HS_MODE)
766
-    if (bltouch.triggered()) bltouch._reset();
769
+  #if ENABLED(BLTOUCH)
770
+    if (bltouch.high_speed_mode && bltouch.triggered())
771
+      bltouch._reset();
767 772
   #endif
768 773
 
769 774
   // On delta keep Z below clip height or do_blocking_move_to will abort

+ 31
- 12
Marlin/src/module/settings.cpp 파일 보기

@@ -301,7 +301,10 @@ typedef struct SettingsDataStruct {
301 301
   //
302 302
   // BLTOUCH
303 303
   //
304
-  bool bltouch_last_written_mode;
304
+  bool bltouch_od_5v_mode;
305
+  #ifdef BLTOUCH_HS_MODE
306
+    bool bltouch_high_speed_mode;                       // M401 S
307
+  #endif
305 308
 
306 309
   //
307 310
   // Kinematic Settings
@@ -918,9 +921,15 @@ void MarlinSettings::postprocess() {
918 921
     // BLTOUCH
919 922
     //
920 923
     {
921
-      _FIELD_TEST(bltouch_last_written_mode);
922
-      const bool bltouch_last_written_mode = TERN(BLTOUCH, bltouch.last_written_mode, false);
923
-      EEPROM_WRITE(bltouch_last_written_mode);
924
+      _FIELD_TEST(bltouch_od_5v_mode);
925
+      const bool bltouch_od_5v_mode = TERN0(BLTOUCH, bltouch.od_5v_mode);
926
+      EEPROM_WRITE(bltouch_od_5v_mode);
927
+
928
+      #ifdef BLTOUCH_HS_MODE
929
+        _FIELD_TEST(bltouch_high_speed_mode);
930
+        const bool bltouch_high_speed_mode = TERN0(BLTOUCH, bltouch.high_speed_mode);
931
+        EEPROM_WRITE(bltouch_high_speed_mode);
932
+      #endif
924 933
     }
925 934
 
926 935
     //
@@ -1810,13 +1819,23 @@ void MarlinSettings::postprocess() {
1810 1819
       // BLTOUCH
1811 1820
       //
1812 1821
       {
1813
-        _FIELD_TEST(bltouch_last_written_mode);
1822
+        _FIELD_TEST(bltouch_od_5v_mode);
1814 1823
         #if ENABLED(BLTOUCH)
1815
-          const bool &bltouch_last_written_mode = bltouch.last_written_mode;
1824
+          const bool &bltouch_od_5v_mode = bltouch.od_5v_mode;
1816 1825
         #else
1817
-          bool bltouch_last_written_mode;
1826
+          bool bltouch_od_5v_mode;
1827
+        #endif
1828
+        EEPROM_READ(bltouch_od_5v_mode);
1829
+
1830
+        #ifdef BLTOUCH_HS_MODE
1831
+          _FIELD_TEST(bltouch_high_speed_mode);
1832
+          #if ENABLED(BLTOUCH)
1833
+            const bool &bltouch_high_speed_mode = bltouch.high_speed_mode;
1834
+          #else
1835
+            bool bltouch_high_speed_mode;
1836
+          #endif
1837
+          EEPROM_READ(bltouch_high_speed_mode);
1818 1838
         #endif
1819
-        EEPROM_READ(bltouch_last_written_mode);
1820 1839
       }
1821 1840
 
1822 1841
       //
@@ -2827,11 +2846,11 @@ void MarlinSettings::reset() {
2827 2846
   TERN_(HAS_PTC, ptc.reset());
2828 2847
 
2829 2848
   //
2830
-  // BLTOUCH
2849
+  // BLTouch
2831 2850
   //
2832
-  //#if ENABLED(BLTOUCH)
2833
-  //  bltouch.last_written_mode;
2834
-  //#endif
2851
+  #ifdef BLTOUCH_HS_MODE
2852
+    bltouch.high_speed_mode = ENABLED(BLTOUCH_HS_MODE);
2853
+  #endif
2835 2854
 
2836 2855
   //
2837 2856
   // Kinematic settings

Loading…
취소
저장