Move RRW keypad code to a common method (#12429)

This commit is contained in:
Scott Lahteine
2018-11-14 06:00:21 -06:00
committed by GitHub
parent 54ec5528a0
commit f4c128ecaa
4 changed files with 101 additions and 83 deletions

View File

@ -63,8 +63,6 @@
#endif
#define LCD_UPDATE_INTERVAL 100
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
#if HAS_LCD_MENU
@ -99,6 +97,9 @@
#define EN_A _BV(BLEN_A)
#define EN_B _BV(BLEN_B)
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
#if BUTTON_EXISTS(ENC)
#define BLEN_C 2
#define EN_C _BV(BLEN_C)
@ -466,6 +467,10 @@ public:
#if HAS_ENCODER_ACTION
static volatile uint8_t buttons;
#if ENABLED(REPRAPWORLD_KEYPAD)
static volatile uint8_t buttons_reprapworld_keypad;
static bool handle_keypad();
#endif
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
static volatile uint8_t slow_buttons;
static uint8_t read_slow_buttons();