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.
This commit is contained in:
AnHardt 2015-10-09 21:35:36 +02:00 committed by Richard Wackerbarth
parent e293ea57f0
commit 96d0d04b8f

View File

@ -1571,10 +1571,6 @@ void lcd_update() {
static millis_t return_to_status_ms = 0; static millis_t return_to_status_ms = 0;
#endif #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(); lcd_buttons_update();
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
@ -1605,6 +1601,10 @@ void lcd_update() {
millis_t ms = millis(); millis_t ms = millis();
if (ms > next_lcd_update_ms) { 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(ULTIPANEL)
#if ENABLED(REPRAPWORLD_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD)