Skip to content

Commit

Permalink
🐛 Minor Fixed-Time Motion patches
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 6, 2023
1 parent 40895cb commit af4ba2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,11 @@ void setup() {
SETUP_RUN(bdl.init(I2C_BD_SDA_PIN, I2C_BD_SCL_PIN, I2C_BD_DELAY));
#endif


#if ENABLED(FT_MOTION)
SETUP_RUN(fxdTiCtrl.init());
#endif

marlin_state = MF_RUNNING;

#ifdef STARTUP_TUNE
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -4030,6 +4030,13 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#endif
#endif

/**
* Fixed-Time Motion limitations
*/
#if ENABLED(FT_MOTION) && (NUM_AXES > 3 || E_STEPPERS > 1 || NUM_Z_STEPPERS > 1 || ANY(DUAL_X_CARRIAGE, HAS_DUAL_X_STEPPERS, HAS_DUAL_Y_STEPPERS, HAS_MULTI_EXTRUDER, MIXING_EXTRUDER))
#error "FT_MOTION is currently limited to machines with 3 linear axes and a single extruder."
#endif

// Multi-Stepping Limit
static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING_LIMIT), "MULTISTEPPING_LIMIT must be 1, 2, 4, 8, 16, 32, 64, or 128.");

Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/module/ft_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ void FxdTiCtrl::loop() {

if (!cfg_mode) return;

static bool initd = false;
if (!initd) { init(); initd = true; }

// Handle block abort with the following sequence:
// 1. Zero out commands in stepper ISR.
// 2. Drain the motion buffer, stop processing until they are emptied.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3466,7 +3466,7 @@ void Stepper::report_positions() {

#if HAS_Z_AXIS
// Update step counts
if (z_step) count_position.z += z_dir ? -1 : 1;
if (z_step) count_position.z += z_dir ? 1 : -1;
#endif

AWAIT_HIGH_PULSE();
Expand Down

0 comments on commit af4ba2b

Please sign in to comment.