Skip to content

Commit

Permalink
Apply NO_MOTION_BEFORE_HOMING to joystick motion (MarlinFirmware#20462)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
2 people authored and zillarob committed Feb 25, 2021
1 parent fccc7ce commit 2bf4843
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 2bf4843

Please sign in to comment.