Skip to content

Commit

Permalink
Changed slow buttons behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikZalm committed Nov 17, 2013
1 parent 69af392 commit a94e588
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ============================
Expand Down
15 changes: 12 additions & 3 deletions Marlin/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a94e588

Please sign in to comment.