Skip to content

Commit

Permalink
enable functionality REVERSE_ENCODER_DIRECTION (#1330)
Browse files Browse the repository at this point in the history
Changed rotary_encoder.cpp to enable the use of REVERSE_ENCODER_DIRECTION. If Makro is defined Encoder direction is now reversed.
  • Loading branch information
Schokotux authored Aug 21, 2021
1 parent 22796b1 commit bcab3f5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Marlin/src/lcd/e3v2/creality/rotary_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
}

if (ABS(temp_diff) >= ENCODER_PULSES_PER_STEP) {
if (temp_diff > 0) temp_diffState = ENCODER_DIFF_CW;
else temp_diffState = ENCODER_DIFF_CCW;
#if ENABLED(REVERSE_ENCODER_DIRECTION)
if (temp_diff > 0) temp_diffState = ENCODER_DIFF_CCW;
else temp_diffState = ENCODER_DIFF_CW;
#else
if (temp_diff > 0) temp_diffState = ENCODER_DIFF_CW;
else temp_diffState = ENCODER_DIFF_CCW;
#endif

#if ENABLED(ENCODER_RATE_MULTIPLIER)

Expand Down

0 comments on commit bcab3f5

Please sign in to comment.