Skip to content

[BUG] ultralcd.cpp screen_click() bug #19051

@andreibobirica

Description

@andreibobirica

<### Bug Description

My Configurations

Now my configuration with the problem resolved:
https://github.com/andreibobirica/Marlin/blob/4755003463bc5026358ae8ef5cf1cb69fe7f374b/Marlin/src/lcd/ultralcd.cpp#L1572

Steps to Reproduce

Use Marlin 2.0.x or buxfix 2.0.x with an TFT screen with FSMC_GRAPHICAL_TFT actived and classic UI.
This bug is noticeable only in the EDIT screen.
However, it also creates numerous problems in mesh bed leveling screens.

Expected behavior: [What you expect to happen]
1 click, 1 encoder action

Actual behavior: [What actually happens]
1 click, hundreds of action (one every clock of the screen)

Additional Information

To solve the problem, just encapsulate the function with a timer.

void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t, const uint8_t) {
      const millis_t now = millis();
      if (ELAPSED(now, next_button_update_ms)) {
       ......
      }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions