Browse Source

Add 'BTN_ENC_EN' for SKR V1.4 with DOGM (#19796)

Gurmeet Athwal 3 years ago
parent
commit
62ba799d72
No account linked to committer's email address

+ 10
- 2
Marlin/src/lcd/marlinui.cpp View File

337
       SET_INPUT_PULLUP(BTN_ENC);
337
       SET_INPUT_PULLUP(BTN_ENC);
338
     #endif
338
     #endif
339
 
339
 
340
+    #if BUTTON_EXISTS(ENC_EN)
341
+      SET_INPUT_PULLUP(BTN_ENC_EN);
342
+    #endif
343
+
340
     #if BUTTON_EXISTS(BACK)
344
     #if BUTTON_EXISTS(BACK)
341
       SET_INPUT_PULLUP(BTN_BACK);
345
       SET_INPUT_PULLUP(BTN_BACK);
342
     #endif
346
     #endif
957
 
961
 
958
           #endif // ENCODER_RATE_MULTIPLIER
962
           #endif // ENCODER_RATE_MULTIPLIER
959
 
963
 
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
+
961
           encoderDiff = 0;
968
           encoderDiff = 0;
962
         }
969
         }
963
 
970
 
1175
             if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
1182
             if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
1176
           #endif
1183
           #endif
1177
           #if BUTTON_EXISTS(ENC)
1184
           #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;
1179
           #endif
1187
           #endif
1180
           #if BUTTON_EXISTS(BACK)
1188
           #if BUTTON_EXISTS(BACK)
1181
             if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
1189
             if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;

+ 5
- 0
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

399
         #define LCD_PINS_D5                P1_21
399
         #define LCD_PINS_D5                P1_21
400
         #define LCD_PINS_D6                P1_22
400
         #define LCD_PINS_D6                P1_22
401
         #define LCD_PINS_D7                P1_23
401
         #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
+
402
       #endif
407
       #endif
403
 
408
 
404
     #endif // !FYSETC_MINI_12864
409
     #endif // !FYSETC_MINI_12864

+ 3
- 0
Marlin/src/pins/pinsDebug_list.h View File

147
 #if defined(BTN_EN2) && BTN_EN2 >= 0
147
 #if defined(BTN_EN2) && BTN_EN2 >= 0
148
   REPORT_NAME_DIGITAL(__LINE__, BTN_EN2)
148
   REPORT_NAME_DIGITAL(__LINE__, BTN_EN2)
149
 #endif
149
 #endif
150
+#if defined(BTN_ENC_EN) && BTN_ENC_EN >= 0
151
+  REPORT_NAME_DIGITAL(__LINE__, BTN_ENC_EN)
152
+#endif
150
 #if defined(BTN_ENC) && BTN_ENC >= 0
153
 #if defined(BTN_ENC) && BTN_ENC >= 0
151
   REPORT_NAME_DIGITAL(__LINE__, BTN_ENC)
154
   REPORT_NAME_DIGITAL(__LINE__, BTN_ENC)
152
 #endif
155
 #endif

Loading…
Cancel
Save