Rotary encoder cleanup (#20753)

This commit is contained in:
Scott Lahteine
2021-01-12 20:43:52 -06:00
committed by GitHub
parent 2b928b4754
commit 4a89731025
30 changed files with 484 additions and 438 deletions

View File

@ -468,19 +468,10 @@ void lv_encoder_pin_init() {
#if ANY_BUTTON(EN1, EN2, ENC, BACK)
uint8_t newbutton = 0;
#if BUTTON_EXISTS(EN1)
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
#endif
#if BUTTON_EXISTS(EN2)
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
#endif
#if BUTTON_EXISTS(ENC)
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
#endif
#if BUTTON_EXISTS(BACK)
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
#endif
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
#else
@ -488,7 +479,6 @@ void lv_encoder_pin_init() {
#endif
static uint8_t buttons = 0;
buttons = newbutton;
static uint8_t lastEncoderBits;