File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,14 @@ bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drai
4242#include " ../core/debug_out.h"
4343
4444bool BLTouch::command (const BLTCommand cmd, const millis_t &ms) {
45- if (DEBUGGING (LEVELING)) SERIAL_ECHOLNPGM (" BLTouch Command :" , cmd);
46- servo[Z_PROBE_SERVO_NR].move (cmd);
47- safe_delay (_MAX (ms, (uint32_t )BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
45+ const BLTCommand current = servo[Z_PROBE_SERVO_NR].read ();
46+ if (DEBUGGING (LEVELING)) SERIAL_ECHOLNPGM (" BLTouch from " , current, " to " , cmd);
47+ // If the new command is the same, skip it (and the delay).
48+ // The previous write should've already delayed to detect the alarm.
49+ if (cmd != current) {
50+ servo[Z_PROBE_SERVO_NR].move (cmd);
51+ safe_delay (_MAX (ms, (uint32_t )BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay
52+ }
4853 return triggered ();
4954}
5055
You can’t perform that action at this time.
0 commit comments