Skip to content

Commit

Permalink
just reverse menus
Browse files Browse the repository at this point in the history
should be set to "menu direction" for main menu buttons
  • Loading branch information
thinkyhead committed May 22, 2024
1 parent defd927 commit 67af37f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Marlin/src/lcd/e3v2/common/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ EncoderState encoderReceiveAnalyze() {
else return ENCODER_DIFF_NO;
}

const int8_t delta = ui.get_encoder_delta();
temp_diff += TERN0(REVERSIBLE_ENCODER, ui.reverse_encoder) ? -delta : delta;
temp_diff += ui.get_encoder_delta();

const int8_t abs_diff = ABS(temp_diff);
if (abs_diff >= ENCODER_PULSES_PER_STEP) {
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,12 @@ class MarlinUI {
}

FORCE_INLINE static void encoder_direction_menus() {
TERN_(REVERSE_MENU_DIRECTION, encoderDirection = -(ENCODERBASE));
constexpr int8_t dir = TERN(REVERSE_MENU_DIRECTION, -(ENCODERBASE), ENCODERBASE);
#if ENABLED(REVERSIBLE_ENCODER)
encoderDirection = reverse_encoder ? -dir : dir;
#elif ENABLED(REVERSE_MENU_DIRECTION)
encoderDirection = dir;
#endif
}

FORCE_INLINE static void encoder_direction_select() {
Expand Down

0 comments on commit 67af37f

Please sign in to comment.