Browse Source

Fix screen click reading too often (#19696)

Co-authored-by: andreibobirica <39415547+andreibobirica@users.noreply.github.com>
Scott Lahteine 3 years ago
parent
commit
ce830f8a71
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      Marlin/src/lcd/ultralcd.cpp

+ 4
- 1
Marlin/src/lcd/ultralcd.cpp View File

@@ -1553,12 +1553,15 @@ void MarlinUI::update() {
1553 1553
     //  - On edit screens, touch Up Half for -,  Bottom Half to +
1554 1554
     //
1555 1555
     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
1556 1559
       const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1,
1557 1560
                    ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1;
1558 1561
       if (on_edit_screen)
1559 1562
         encoderDiff = epps * ydir;
1560 1563
       else if (screen_items > 0) {
1561
-        // Last 3 cols act as a scroll :-)
1564
+        // Last 5 cols act as a scroll :-)
1562 1565
         if (col > (LCD_WIDTH) - 5)
1563 1566
           // 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.)
1564 1567
           encoderDiff = epps * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir;

Loading…
Cancel
Save