Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply NO_MOTION_BEFORE_HOMING for joystick motion #20462

Merged
merged 3 commits into from
Dec 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Marlin/src/feature/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Joystick joystick;
static bool injecting_now; // = false;
if (injecting_now) return;

#if ENABLED(NO_MOTION_BEFORE_HOMING)
if (TERN0(HAS_JOY_ADC_X, axis_should_home(X_AXIS)) || TERN0(HAS_JOY_ADC_Y, axis_should_home(Y_AXIS)) || TERN0(HAS_JOY_ADC_Z, axis_should_home(Z_AXIS)))
return;
#endif

static constexpr int QUEUE_DEPTH = 5; // Insert up to this many movements
static constexpr float target_lag = 0.25f, // Aim for 1/4 second lag
seg_time = target_lag / QUEUE_DEPTH; // 0.05 seconds, short segments inserted every 1/20th of a second
Expand Down