From 7aedf18fd9e7186cb0ae8ec9785a36c85b65135f Mon Sep 17 00:00:00 2001
From: 7eggert <7eggert@gmx.de>
Date: Thu, 14 Feb 2019 03:50:11 +0100
Subject: [PATCH] Optional ADC_KEYPAD pin with ANET_10 (#13158)

---
 Marlin/pins_ANET_10.h | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/Marlin/pins_ANET_10.h b/Marlin/pins_ANET_10.h
index a8cbd5f29c..36443c8805 100644
--- a/Marlin/pins_ANET_10.h
+++ b/Marlin/pins_ANET_10.h
@@ -154,31 +154,32 @@
  */
 
 #if ENABLED(ULTRA_LCD)
-  #define LCD_SDSS           28
+  #define LCD_SDSS         28
   #if ENABLED(ADC_KEYPAD)
-    #define SERVO0_PIN       27   // free for BLTouch/3D-Touch
-    #define LCD_PINS_RS      28
-    #define LCD_PINS_ENABLE  29
-    #define LCD_PINS_D4      10
-    #define LCD_PINS_D5      11
-    #define LCD_PINS_D6      16
-    #define LCD_PINS_D7      17
-    #define BTN_EN1          -1
-    #define BTN_EN2          -1
-    #define BTN_ENC          -1
-    #define ADC_KEYPAD_PIN    1
+    #define SERVO0_PIN     27   // free for BLTouch/3D-Touch
+    #ifndef LCD_I2C_TYPE_PCF8575
+      #define LCD_PINS_RS  28
+      #define LCD_PINS_ENABLE 29
+      #define LCD_PINS_D4  10
+      #define LCD_PINS_D5  11
+      #define LCD_PINS_D6  16
+      #define LCD_PINS_D7  17
+    #endif
+    #ifndef ADC_KEYPAD_PIN
+      #define ADC_KEYPAD_PIN 1   // Analog Input
+    #endif
   #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
     // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
     // display using an adapter board  // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
     // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748
-    #define SERVO0_PIN       29   // free for BLTouch/3D-Touch
-    #define BEEPER_PIN       17
-    #define LCD_PINS_RS      27
-    #define LCD_PINS_ENABLE  28
-    #define LCD_PINS_D4      30
-    #define BTN_EN1          11
-    #define BTN_EN2          10
-    #define BTN_ENC          16
+    #define SERVO0_PIN     29   // free for BLTouch/3D-Touch
+    #define BEEPER_PIN     17
+    #define LCD_PINS_RS    27
+    #define LCD_PINS_ENABLE 28
+    #define LCD_PINS_D4    30
+    #define BTN_EN1        11
+    #define BTN_EN2        10
+    #define BTN_ENC        16
     #ifndef ST7920_DELAY_1
       #define ST7920_DELAY_1 DELAY_NS(0)
     #endif
@@ -192,7 +193,7 @@
     #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
   #endif
 #else
-  #define SERVO0_PIN         27
+  #define SERVO0_PIN       27
 #endif
 
 /**