From a94e58876522bc0f8cb856f91c5609722ffb08df Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Sun, 17 Nov 2013 17:41:30 +0100 Subject: [PATCH] Changed slow buttons behavior. --- Marlin/Configuration_adv.h | 2 +- Marlin/ultralcd.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 103bb538f..7b3ef4aed 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -366,7 +366,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif // Control heater 0 and heater 1 in parallel. -#define HEATERS_PARALLEL +//#define HEATERS_PARALLEL //=========================================================================== //=============================Buffers ============================ diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index e3e2556fa..163c881e1 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -142,6 +142,9 @@ volatile uint8_t buttons;//Contains the bits of the currently pressed buttons. #else volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values #endif +#ifdef LCD_HAS_SLOW_BUTTONS +volatile uint8_t slow_buttons;//Contains the bits of the currently pressed buttons. +#endif uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ uint32_t blocking_enc; uint8_t lastEncoderBits; @@ -1013,6 +1016,9 @@ void lcd_init() WRITE(SDCARDDETECT, HIGH); lcd_oldcardstatus = IS_SD_INSERTED; #endif//(SDCARDDETECT > 0) + #ifdef LCD_HAS_SLOW_BUTTONS + slow_buttons = 0; + #endif lcd_buttons_update(); #ifdef ULTIPANEL encoderDiff = 0; @@ -1023,12 +1029,12 @@ void lcd_update() { static unsigned long timeoutToStatus = 0; - lcd_buttons_update(); - #ifdef LCD_HAS_SLOW_BUTTONS - buttons |= lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context + slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context #endif + lcd_buttons_update(); + #if (SDCARDDETECT > 0) if((IS_SD_INSERTED != lcd_oldcardstatus)) { @@ -1170,6 +1176,9 @@ void lcd_buttons_update() newbutton |= EN_C; #endif buttons = newbutton; + #ifdef LCD_HAS_SLOW_BUTTONS + buttons |= slow_buttons; + #endif #ifdef REPRAPWORLD_KEYPAD // for the reprapworld_keypad uint8_t newbutton_reprapworld_keypad=0;