Skip to content

Commit c09b25d

Browse files
⛙ Merge w/Marlin
2 parents f0d6716 + 88829bd commit c09b25d

File tree

34 files changed

+69
-31
lines changed

34 files changed

+69
-31
lines changed

Marlin/Configuration.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,6 @@
15311531
* For information about this sensor https://github.com/bigtreetech/MicroProbe
15321532
*
15331533
* Also requires PROBE_ENABLE_DISABLE
1534-
* With FT_MOTION requires ENDSTOP_INTERRUPTS_FEATURE
15351534
*/
15361535
//#define BIQU_MICROPROBE_V1 // Triggers HIGH
15371536
//#define BIQU_MICROPROBE_V2 // Triggers LOW

Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
#include "../hilbert_curve.h"
5353
#endif
5454

55+
#if FT_MOTION_DISABLE_FOR_PROBING
56+
#include "../../../module/ft_motion.h"
57+
#endif
58+
5559
#include <math.h>
5660

5761
#define UBL_G29_P31
@@ -314,6 +318,10 @@ void unified_bed_leveling::G29() {
314318
const uint8_t p_val = parser.byteval('P');
315319
const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen_test('J');
316320

321+
#if FT_MOTION_DISABLE_FOR_PROBING
322+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing
323+
#endif
324+
317325
// Check for commands that require the printer to be homed
318326
if (may_move) {
319327
planner.synchronize();

Marlin/src/gcode/bedlevel/abl/G29.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
6161
#include "../../../core/debug_out.h"
6262

63+
#if DISABLED(PROBE_MANUALLY) && FT_MOTION_DISABLE_FOR_PROBING
64+
#include "../../../module/ft_motion.h"
65+
#endif
66+
6367
#if ABL_USES_GRID
6468
#if ENABLED(PROBE_Y_FIRST)
6569
#define PR_OUTER_VAR abl.meshCount.x
@@ -288,6 +292,10 @@ G29_TYPE GcodeSuite::G29() {
288292
// Set and report "probing" state to host
289293
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE, false));
290294

295+
#if DISABLED(PROBE_MANUALLY) && FT_MOTION_DISABLE_FOR_PROBING
296+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing
297+
#endif
298+
291299
/**
292300
* On the initial G29 fetch command parameters.
293301
*/

Marlin/src/gcode/bedlevel/mbl/G29.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
4646
#include "../../../core/debug_out.h"
4747

48+
#if FT_MOTION_DISABLE_FOR_PROBING
49+
#include "../../module/ft_motion.h"
50+
#endif
51+
4852
// Save 130 bytes with non-duplication of PSTR
4953
inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); }
5054

@@ -63,6 +67,10 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM("
6367
*/
6468
void GcodeSuite::G29() {
6569

70+
#if FT_MOTION_DISABLE_FOR_PROBING
71+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing
72+
#endif
73+
6674
DEBUG_SECTION(log_G29, "G29", true);
6775

6876
// G29 Q is also available if debugging

Marlin/src/gcode/calibrate/G28.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
#include "../../feature/bltouch.h"
5353
#endif
5454

55+
#if FT_MOTION_DISABLE_FOR_PROBING
56+
#include "../../module/ft_motion.h"
57+
#endif
58+
5559
#include "../../lcd/marlinui.h"
5660

5761
#if ENABLED(EXTENSIBLE_UI)
@@ -129,6 +133,11 @@
129133
#if ENABLED(Z_SAFE_HOMING)
130134

131135
inline void home_z_safely() {
136+
137+
#if FT_MOTION_DISABLE_FOR_PROBING
138+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for homing
139+
#endif
140+
132141
DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING));
133142

134143
// Disallow Z homing if X or Y homing is needed
@@ -284,6 +293,10 @@ void GcodeSuite::G28() {
284293
motion_state_t saved_motion_state = begin_slow_homing();
285294
#endif
286295

296+
#if FT_MOTION_DISABLE_FOR_PROBING
297+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for homing
298+
#endif
299+
287300
// Always home with tool 0 active
288301
#if HAS_MULTI_HOTEND
289302
#if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)

Marlin/src/gcode/probe/G30.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include "../../feature/probe_temp_comp.h"
3535
#endif
3636

37+
#if FT_MOTION_DISABLE_FOR_PROBING
38+
#include "../../module/ft_motion.h"
39+
#endif
40+
3741
#if ANY(DWIN_LCD_PROUI, EXTENSIBLE_UI)
3842
#define VERBOSE_SINGLE_PROBE
3943
#endif
@@ -76,6 +80,10 @@ void GcodeSuite::G30() {
7680
// Use 'C' to set Probe Temperature Compensation ON/OFF (on by default)
7781
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));
7882

83+
#if FT_MOTION_DISABLE_FOR_PROBING
84+
FTMotionDisableInScope FT_Disabler; // Disable Fixed-Time Motion for probing
85+
#endif
86+
7987
// Probe the bed, optionally raise, and return the measured height
8088
const float measured_z = probe.probe_at_point(probepos, raise_after);
8189

Marlin/src/inc/Conditionals-4-adv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,9 @@
14221422
#define FTM_WINDOW_SIZE FTM_BW_SIZE
14231423
#define FTM_BATCH_SIZE FTM_BW_SIZE
14241424
#endif
1425+
#if ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
1426+
#define FT_MOTION_DISABLE_FOR_PROBING 1
1427+
#endif
14251428
#endif
14261429

14271430
// Multi-Stepping Limit

Marlin/src/inc/SanityCheck.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,10 +1457,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
14571457
#error "BIQU MicroProbe requires a PROBE_ENABLE_PIN."
14581458
#endif
14591459

1460-
#if ENABLED(FT_MOTION) && DISABLED(ENDSTOP_INTERRUPTS_FEATURE)
1461-
#error "BIQU Microprobe requires ENDSTOP_INTERRUPTS_FEATURE with FT_MOTION."
1462-
#endif
1463-
14641460
#if ENABLED(BIQU_MICROPROBE_V1)
14651461
#if ENABLED(INVERTED_PROBE_STATE)
14661462
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW

Marlin/src/module/ft_motion.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ void FTMotion::reset() {
382382
steps.reset();
383383
interpIdx = 0;
384384

385-
stepper.axis_did_move.reset();
386-
387385
#if HAS_FTM_SHAPING
388386
TERN_(HAS_X_AXIS, ZERO(shaping.x.d_zi));
389387
TERN_(HAS_Y_AXIS, ZERO(shaping.y.d_zi));

Marlin/src/module/ft_motion.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,18 @@ class FTMotion {
213213

214214
FORCE_INLINE static int32_t num_samples_shaper_settle() { return ( shaping.x.ena || shaping.y.ena ) ? FTM_ZMAX : 0; }
215215

216-
217216
}; // class FTMotion
218217

219218
extern FTMotion ftMotion;
219+
220+
typedef struct FTMotionDisableInScope {
221+
bool isactive;
222+
FTMotionDisableInScope() {
223+
isactive = ftMotion.cfg.active;
224+
ftMotion.cfg.active = false;
225+
}
226+
~FTMotionDisableInScope() {
227+
ftMotion.cfg.active = isactive;
228+
if (isactive) ftMotion.init();
229+
}
230+
} FTMotionDisableInScope_t;

0 commit comments

Comments
 (0)