Skip to content

Commit

Permalink
lastEncoderDiff Compiler Warning
Browse files Browse the repository at this point in the history
Fixes a compiler warning by making the appropriate lines conditional.
  • Loading branch information
soligen2010 authored Dec 18, 2023
1 parent 0ede16c commit 0b0debb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,9 @@ void MarlinUI::init() {
uint8_t abs_diff = ABS(encoderDiff);

#if ENCODER_PULSES_PER_STEP > 1
static int8_t lastEncoderDiff;
TERN_(HAS_TOUCH_SLEEP, static int8_t lastEncoderDiff);
TERN_(HAS_TOUCH_SLEEP, if (lastEncoderDiff != encoderDiff) wakeup_screen());
lastEncoderDiff = encoderDiff;
TERN_(HAS_TOUCH_SLEEP, lastEncoderDiff = encoderDiff);
#endif

const bool encoderPastThreshold = (abs_diff >= epps);
Expand Down

0 comments on commit 0b0debb

Please sign in to comment.