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

Fix compiler warning and potential string buffer overflow #26550

Merged
merged 10 commits into from
Dec 25, 2023
Prev Previous commit
Next Next commit
Suggested style change from classicrocker883
Accepted suggested change in pull request comment
  • Loading branch information
soligen2010 authored Dec 18, 2023
commit 2c4c28dbbc3e67495f3f5eb6aa18b620035e4c3d
10 changes: 6 additions & 4 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,13 @@ void MarlinUI::init() {
uint8_t abs_diff = ABS(encoderDiff);

#if ENCODER_PULSES_PER_STEP > 1
TERN_(HAS_TOUCH_SLEEP, static int8_t lastEncoderDiff);
TERN_(HAS_TOUCH_SLEEP, if (lastEncoderDiff != encoderDiff) wakeup_screen());
TERN_(HAS_TOUCH_SLEEP, lastEncoderDiff = encoderDiff);
#if HAS_TOUCH_SLEEP
static int8_t lastEncoderDiff);
if (lastEncoderDiff != encoderDiff) wakeup_screen());
lastEncoderDiff = encoderDiff);
soligen2010 marked this conversation as resolved.
Show resolved Hide resolved
#endif
#endif

const bool encoderPastThreshold = (abs_diff >= epps);
if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) {

Expand Down