From 96d0d04b8f78e4cb54e673b33ee4b4c47a9bbc76 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 9 Oct 2015 21:35:36 +0200 Subject: [PATCH] Update LCD buttons less frequently Move slow_buttons_update into the LCD_UPDATE_INTERVAL block lcd_implementation_read_slow_buttons() will then be executed ~10 times a second. --- Marlin/ultralcd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b99bffde0a..64e8cd3706 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1571,10 +1571,6 @@ void lcd_update() { static millis_t return_to_status_ms = 0; #endif - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context - #endif - lcd_buttons_update(); #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) @@ -1605,6 +1601,10 @@ void lcd_update() { millis_t ms = millis(); if (ms > next_lcd_update_ms) { + #if ENABLED(LCD_HAS_SLOW_BUTTONS) + slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context + #endif + #if ENABLED(ULTIPANEL) #if ENABLED(REPRAPWORLD_KEYPAD)