Changed slow buttons behavior.

master
Erik van der Zalm 11 years ago
parent 69af392554
commit a94e588765

@ -366,7 +366,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif #endif
// Control heater 0 and heater 1 in parallel. // Control heater 0 and heater 1 in parallel.
#define HEATERS_PARALLEL //#define HEATERS_PARALLEL
//=========================================================================== //===========================================================================
//=============================Buffers ============================ //=============================Buffers ============================

@ -142,6 +142,9 @@ volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
#else #else
volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values
#endif #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 */ uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
uint32_t blocking_enc; uint32_t blocking_enc;
uint8_t lastEncoderBits; uint8_t lastEncoderBits;
@ -1013,6 +1016,9 @@ void lcd_init()
WRITE(SDCARDDETECT, HIGH); WRITE(SDCARDDETECT, HIGH);
lcd_oldcardstatus = IS_SD_INSERTED; lcd_oldcardstatus = IS_SD_INSERTED;
#endif//(SDCARDDETECT > 0) #endif//(SDCARDDETECT > 0)
#ifdef LCD_HAS_SLOW_BUTTONS
slow_buttons = 0;
#endif
lcd_buttons_update(); lcd_buttons_update();
#ifdef ULTIPANEL #ifdef ULTIPANEL
encoderDiff = 0; encoderDiff = 0;
@ -1023,12 +1029,12 @@ void lcd_update()
{ {
static unsigned long timeoutToStatus = 0; static unsigned long timeoutToStatus = 0;
lcd_buttons_update();
#ifdef LCD_HAS_SLOW_BUTTONS #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 #endif
lcd_buttons_update();
#if (SDCARDDETECT > 0) #if (SDCARDDETECT > 0)
if((IS_SD_INSERTED != lcd_oldcardstatus)) if((IS_SD_INSERTED != lcd_oldcardstatus))
{ {
@ -1170,6 +1176,9 @@ void lcd_buttons_update()
newbutton |= EN_C; newbutton |= EN_C;
#endif #endif
buttons = newbutton; buttons = newbutton;
#ifdef LCD_HAS_SLOW_BUTTONS
buttons |= slow_buttons;
#endif
#ifdef REPRAPWORLD_KEYPAD #ifdef REPRAPWORLD_KEYPAD
// for the reprapworld_keypad // for the reprapworld_keypad
uint8_t newbutton_reprapworld_keypad=0; uint8_t newbutton_reprapworld_keypad=0;

Loading…
Cancel
Save