Skip to content

Commit 65e3c2e

Browse files
thinkyheadandreibobirica
authored andcommitted
Fix screen click reading too often (MarlinFirmware#19696)
Co-authored-by: andreibobirica <39415547+andreibobirica@users.noreply.github.com>
1 parent 3d217f2 commit 65e3c2e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Marlin/src/lcd/ultralcd.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,12 +1553,15 @@ void MarlinUI::update() {
15531553
// - On edit screens, touch Up Half for -, Bottom Half to +
15541554
//
15551555
void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t, const uint8_t) {
1556+
const millis_t now = millis();
1557+
if (PENDING(now, next_button_update_ms)) return;
1558+
next_button_update_ms = now + repeat_delay; // Assume the repeat delay
15561559
const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1,
15571560
ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1;
15581561
if (on_edit_screen)
15591562
encoderDiff = epps * ydir;
15601563
else if (screen_items > 0) {
1561-
// Last 3 cols act as a scroll :-)
1564+
// Last 5 cols act as a scroll :-)
15621565
if (col > (LCD_WIDTH) - 5)
15631566
// 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.)
15641567
encoderDiff = epps * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir;

0 commit comments

Comments
 (0)