From 4581957d93d5f24c858e461c703edfde69846e31 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 21 Aug 2019 05:15:31 -0500
Subject: [PATCH] Clean up some pins

---
 Marlin/src/pins/linux/pins_RAMPS_LINUX.h   |  2 +-
 Marlin/src/pins/mega/pins_MEGATRONICS_2.h  | 52 ++++++++++++----------
 Marlin/src/pins/rambo/pins_RAMBO.h         |  2 +-
 Marlin/src/pins/ramps/pins_RAMPS.h         |  2 +-
 Marlin/src/pins/ramps/pins_TT_OSCAR.h      |  2 +-
 Marlin/src/pins/ramps/pins_ULTIMAKER.h     |  4 +-
 Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h |  4 +-
 Marlin/src/pins/stm32/pins_BEAST.h         |  4 +-
 Marlin/src/pins/stm32/pins_CHITU3D.h       | 12 ++---
 Marlin/src/pins/stm32/pins_STM32F1R.h      |  4 +-
 Marlin/src/pins/stm32/pins_STM3R_MINI.h    |  4 +-
 11 files changed, 49 insertions(+), 43 deletions(-)

diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
index 06a29dfb6c..48cdb1dd62 100644
--- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
+++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
@@ -437,7 +437,7 @@
     #endif
 
     #if DISABLED(NEWPANEL)
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK       38
       //#define SHIFT_LD        42
diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
index d05ae71587..4cd5999604 100644
--- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
+++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
@@ -115,32 +115,38 @@
 #define PS_ON_PIN          12
 #define CASE_LIGHT_PIN      2
 
-//
-// LCD / Controller
-//
-#define BEEPER_PIN         64
-
-#define LCD_PINS_RS        14
-#define LCD_PINS_ENABLE    15
-#define LCD_PINS_D4        30
-#define LCD_PINS_D5        31
-#define LCD_PINS_D6        32
-#define LCD_PINS_D7        33
-
-// Buttons are directly attached using keypad
-#define BTN_EN1            61
-#define BTN_EN2            59
-#define BTN_ENC            43
-
-// Buttons that are attached using shift register of reprapworld keypad  v1.1
-#define SHIFT_CLK 63
-#define SHIFT_LD 42
-#define SHIFT_OUT 17
-#define SHIFT_EN 17
-
 //
 // M3/M4/M5 - Spindle/Laser Control
 //
 #define SPINDLE_LASER_PWM_PIN     3   // Hardware PWM
 #define SPINDLE_LASER_ENA_PIN    16   // Pullup!
 #define SPINDLE_DIR_PIN          11
+
+//
+// LCD / Controller
+//
+#define BEEPER_PIN         64
+
+#if HAS_SPI_LCD
+
+  #define LCD_PINS_RS      14
+  #define LCD_PINS_ENABLE  15
+  #define LCD_PINS_D4      30
+  #define LCD_PINS_D5      31
+  #define LCD_PINS_D6      32
+  #define LCD_PINS_D7      33
+
+  #if ENABLED(NEWPANEL)
+    // Buttons are directly attached using keypad
+    #define BTN_EN1        61
+    #define BTN_EN2        59
+    #define BTN_ENC        43
+  #else
+    // Buttons attached to shift register of reprapworld keypad v1.1
+    #define SHIFT_CLK      63
+    #define SHIFT_LD       42
+    #define SHIFT_OUT      17
+    #define SHIFT_EN       17
+  #endif
+
+#endif // HAS_SPI_LCD
diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h
index fb25fd0ffe..1094e0687e 100644
--- a/Marlin/src/pins/rambo/pins_RAMBO.h
+++ b/Marlin/src/pins/rambo/pins_RAMBO.h
@@ -219,7 +219,7 @@
     // No Beeper added
     #define BEEPER_PIN     33
 
-    // buttons are attached to a shift register
+    // Buttons attached to a shift register
     // Not wired yet
     //#define SHIFT_CLK 38
     //#define SHIFT_LD 42
diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h
index f820158cf2..1ed9e32d24 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS.h
@@ -477,7 +477,7 @@
     #endif
 
     #if DISABLED(NEWPANEL)
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK       38
       //#define SHIFT_LD        42
diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
index a67de0ecd0..b639d0b25a 100644
--- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h
+++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
@@ -337,7 +337,7 @@
     #endif
 
     #if DISABLED(NEWPANEL)
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK    38
       //#define SHIFT_LD     42
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
index 1fbef17bba..b2594acebc 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
@@ -129,7 +129,7 @@
     #define LCD_PINS_D6     5
     #define LCD_PINS_D7     6
 
-    // buttons are directly attached
+    // Buttons directly attached
     #define BTN_EN1 40
     #define BTN_EN2 42
     #define BTN_ENC 19
@@ -138,7 +138,7 @@
 
   #else // !NEWPANEL - Old style panel with shift register
 
-    // buttons are attached to a shift register
+    // Buttons attached to a shift register
     #define SHIFT_CLK 38
     #define SHIFT_LD 42
     #define SHIFT_OUT 40
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
index 65e0416612..dd9aaf1292 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
@@ -187,7 +187,7 @@
     #define LCD_PINS_D6     5
     #define LCD_PINS_D7     6
 
-    // buttons are directly attached
+    // Buttons directly attached
     #define BTN_EN1        40
     #define BTN_EN2        42
     #define BTN_ENC        19
@@ -196,7 +196,7 @@
 
   #else // !NEWPANEL - Old style panel with shift register
 
-    // buttons are attached to a shift register
+    // Buttons attached to a shift register
     #define SHIFT_CLK      38
     #define SHIFT_LD       42
     #define SHIFT_OUT      40
diff --git a/Marlin/src/pins/stm32/pins_BEAST.h b/Marlin/src/pins/stm32/pins_BEAST.h
index 5654596913..7b1f61d918 100644
--- a/Marlin/src/pins/stm32/pins_BEAST.h
+++ b/Marlin/src/pins/stm32/pins_BEAST.h
@@ -142,7 +142,7 @@
     #define LCD_PINS_D7         PB15
     #if DISABLED(NEWPANEL)
       #define BEEPER_PIN        33
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK 38
       //#define SHIFT_LD 42
@@ -254,7 +254,7 @@
       // Beeper on AUX-4
       #define BEEPER_PIN        33
 
-      // buttons are directly attached to AUX-2
+      // Buttons directly attached to AUX-2
       #if ENABLED(REPRAPWORLD_KEYPAD)
         #define BTN_EN1         64
         #define BTN_EN2         59
diff --git a/Marlin/src/pins/stm32/pins_CHITU3D.h b/Marlin/src/pins/stm32/pins_CHITU3D.h
index dd9456308f..48b57b3502 100644
--- a/Marlin/src/pins/stm32/pins_CHITU3D.h
+++ b/Marlin/src/pins/stm32/pins_CHITU3D.h
@@ -141,12 +141,12 @@
     #define LCD_PINS_D7         PB15
     #if DISABLED(NEWPANEL)
       #define BEEPER_PIN        33
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
-      //#define SHIFT_CLK 38
-      //#define SHIFT_LD 42
-      //#define SHIFT_OUT 40
-      //#define SHIFT_EN 17
+      //#define SHIFT_CLK       38
+      //#define SHIFT_LD        42
+      //#define SHIFT_OUT       40
+      //#define SHIFT_EN        17
     #endif
   #endif
 
@@ -252,7 +252,7 @@
       // Beeper on AUX-4
       #define BEEPER_PIN        33
 
-      // buttons are directly attached to AUX-2
+      // Buttons directly attached to AUX-2
       #if ENABLED(REPRAPWORLD_KEYPAD)
         #define BTN_EN1         64
         #define BTN_EN2         59
diff --git a/Marlin/src/pins/stm32/pins_STM32F1R.h b/Marlin/src/pins/stm32/pins_STM32F1R.h
index 987f6eda18..ccafcad1f7 100644
--- a/Marlin/src/pins/stm32/pins_STM32F1R.h
+++ b/Marlin/src/pins/stm32/pins_STM32F1R.h
@@ -119,7 +119,7 @@
     #define LCD_PINS_D7         PB15
     #if DISABLED(NEWPANEL)
       #define BEEPER_PIN        33
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK 38
       //#define SHIFT_LD 42
@@ -230,7 +230,7 @@
       // Beeper on AUX-4
       #define BEEPER_PIN        33
 
-      // buttons are directly attached to AUX-2
+      // Buttons directly attached to AUX-2
       #if ENABLED(REPRAPWORLD_KEYPAD)
         #define BTN_EN1         64
         #define BTN_EN2         59
diff --git a/Marlin/src/pins/stm32/pins_STM3R_MINI.h b/Marlin/src/pins/stm32/pins_STM3R_MINI.h
index fc7bc09b61..9192ae453e 100644
--- a/Marlin/src/pins/stm32/pins_STM3R_MINI.h
+++ b/Marlin/src/pins/stm32/pins_STM3R_MINI.h
@@ -134,7 +134,7 @@
     #define LCD_PINS_D7    PB15
     #if DISABLED(NEWPANEL)
       #define BEEPER_PIN   33
-      // Buttons are attached to a shift register
+      // Buttons attached to a shift register
       // Not wired yet
       //#define SHIFT_CLK  38
       //#define SHIFT_LD   42
@@ -254,7 +254,7 @@
       // Beeper on AUX-4
       #define BEEPER_PIN   33
 
-      // buttons are directly attached to AUX-2
+      // Buttons directly attached to AUX-2
       #if ENABLED(REPRAPWORLD_KEYPAD)
         #define BTN_EN1    64
         #define BTN_EN2    59
-- 
GitLab