File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,10 @@ void MarlinUI::init() {
337337 SET_INPUT_PULLUP (BTN_ENC);
338338 #endif
339339
340+ #if BUTTON_EXISTS(ENC_EN)
341+ SET_INPUT_PULLUP (BTN_ENC_EN);
342+ #endif
343+
340344 #if BUTTON_EXISTS(BACK)
341345 SET_INPUT_PULLUP (BTN_BACK);
342346 #endif
@@ -957,7 +961,10 @@ void MarlinUI::update() {
957961
958962 #endif // ENCODER_RATE_MULTIPLIER
959963
960- encoderPosition += (encoderDiff * encoderMultiplier) / epps;
964+ // Update position only when ENC_EN is HIGH
965+ if (TERN1 (BTN_ENC_EN, !BUTTON_PRESSED (ENC_EN)))
966+ encoderPosition += (encoderDiff * encoderMultiplier) / epps;
967+
961968 encoderDiff = 0 ;
962969 }
963970
@@ -1175,7 +1182,8 @@ void MarlinUI::update() {
11751182 if (BUTTON_PRESSED (EN2)) newbutton |= EN_B;
11761183 #endif
11771184 #if BUTTON_EXISTS(ENC)
1178- if (BUTTON_PRESSED (ENC)) newbutton |= EN_C;
1185+ // Update button only when ENC_EN is HIGH
1186+ if (TERN1 (BTN_ENC_EN, !BUTTON_PRESSED (ENC_EN)) && BUTTON_PRESSED (ENC)) newbutton |= EN_C;
11791187 #endif
11801188 #if BUTTON_EXISTS(BACK)
11811189 if (BUTTON_PRESSED (BACK)) newbutton |= EN_D;
Original file line number Diff line number Diff line change 399399 #define LCD_PINS_D5 P1_21
400400 #define LCD_PINS_D6 P1_22
401401 #define LCD_PINS_D7 P1_23
402+
403+ #if ENABLED (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER )
404+ #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
405+ #endif
406+
402407 #endif
403408
404409 #endif // !FYSETC_MINI_12864
Original file line number Diff line number Diff line change 147147#if defined(BTN_EN2 ) && BTN_EN2 >= 0
148148 REPORT_NAME_DIGITAL (__LINE__ , BTN_EN2 )
149149#endif
150+ #if defined(BTN_ENC_EN ) && BTN_ENC_EN >= 0
151+ REPORT_NAME_DIGITAL (__LINE__ , BTN_ENC_EN )
152+ #endif
150153#if defined(BTN_ENC ) && BTN_ENC >= 0
151154 REPORT_NAME_DIGITAL (__LINE__ , BTN_ENC )
152155#endif
You can’t perform that action at this time.
0 commit comments