From 6a21180bd4f42b46cce2ed2375c36879ff4b1a84 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <thinkyhead@users.noreply.github.com>
Date: Tue, 1 Mar 2016 01:24:57 +0000
Subject: [PATCH] Implemented BQ ZUM Mega 3D board layout as an override to
 RAMPS 1.3

---
 Marlin/pins.h                |  3 +-
 Marlin/pins_BQ_ZUM_MEGA_3D.h | 89 ++++++++++++++----------------------
 Marlin/pins_RAMBO.h          |  1 -
 Marlin/pins_RAMPS_13.h       |  2 +-
 4 files changed, 37 insertions(+), 58 deletions(-)

diff --git a/Marlin/pins.h b/Marlin/pins.h
index bc712e7234..c4ec4125dc 100644
--- a/Marlin/pins.h
+++ b/Marlin/pins.h
@@ -16,7 +16,6 @@
 #define E0_MS2_PIN -1
 #define E1_MS1_PIN -1
 #define E1_MS2_PIN -1
-#define DIGIPOTSS_PIN -1
 #define HEATER_3_PIN -1
 #define TEMP_3_PIN -1
 
@@ -269,7 +268,7 @@
     analogInputToDigitalPin(TEMP_BED_PIN) \
   }
 
-#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
+#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
 
 #endif //__PINS_H
 
diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h
index 212129de15..c6604fcd9e 100644
--- a/Marlin/pins_BQ_ZUM_MEGA_3D.h
+++ b/Marlin/pins_BQ_ZUM_MEGA_3D.h
@@ -6,76 +6,57 @@
   #error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
 #endif
 
-#define LARGE_FLASH         true
+#include "pins_RAMPS_13.h"
 
-#define LED_PIN             13
+#undef X_MAX_PIN
+#define X_MAX_PIN         79 //  2
 
-#define X_STEP_PIN          54
-#define X_DIR_PIN           55
-#define X_ENABLE_PIN        38
-#define X_MIN_PIN           3
-#define X_MAX_PIN           79
+#undef Z_ENABLE_PIN
+#define Z_ENABLE_PIN      77 // 62
 
-#define Y_STEP_PIN          60
-#define Y_DIR_PIN           61
-#define Y_ENABLE_PIN        56
-#define Y_MIN_PIN           14
-#define Y_MAX_PIN           15
+#undef FAN_PIN
+#define FAN_PIN           12 //  4
 
-#define Z_STEP_PIN          46
-#define Z_DIR_PIN           48
-#define Z_ENABLE_PIN        77
-#define Z_MIN_PIN           18 // Z-MIN Label
-#define Z_MAX_PIN           19 // IND_S_5V
+#undef HEATER_0_PIN
+#define HEATER_0_PIN       9 // 10
 
-#define E0_STEP_PIN         26
-#define E0_DIR_PIN          28
-#define E0_ENABLE_PIN       24
+#undef HEATER_1_PIN
+#define HEATER_1_PIN      10 //  9
 
-#define E1_STEP_PIN         36
-#define E1_DIR_PIN          34
-#define E1_ENABLE_PIN       30
+#undef TEMP_1_PIN
+#define TEMP_1_PIN        14 // 15
 
-#define FAN_PIN             12
-#define HEATER_0_PIN        9
-#define TEMP_0_PIN          13
+#undef TEMP_BED_PIN
+#define TEMP_BED_PIN      15 // 14
 
-#define FAN1_PIN            7
-#define HEATER_1_PIN        10
-#define TEMP_1_PIN          14
+#define DIGIPOTSS_PIN     22
+#define DIGIPOT_CHANNELS  { 4, 5, 3, 0, 1 }
 
-#define HEATER_BED_PIN      8
-#define TEMP_BED_PIN        15
+#define FAN1_PIN          7
 
-#undef DIGIPOTSS_PIN
-#define DIGIPOTSS_PIN       22
-#define DIGIPOT_CHANNELS    { 4, 5, 3 , 0, 1 }
+#undef PS_ON_PIN             // 12
+#define PS_ON_PIN         81 // External Power Supply
 
-#define PS_ON_PIN           81 // External Power Supply
+#if ENABLED(BQ_LCD_SMART_CONTROLLER) // Most similar to REPRAP_DISCOUNT_SMART_CONTROLLER
+  #define KILL_PIN        41
 
-#if ENABLED(BQ_LCD_SMART_CONTROLLER)
-	#define KILL_PIN        41
+  #define BEEPER_PIN      37
 
-	#define LCD_PIN_BL      39
-	#define LCD_PINS_RS     16
-	#define LCD_PINS_ENABLE 17
-	#define LCD_PINS_D4     23
+  #define BTN_EN1         31
+  #define BTN_EN2         33
+  #define BTN_ENC         35
 
-	#define BTN_EN1         31
-	#define BTN_EN2         33
-	#define BTN_ENC         35
+  #define LCD_PIN_BL      39
+  #define LCD_PINS_RS     16
+  #define LCD_PINS_ENABLE 17
+  #define LCD_PINS_D4     23
 
-	#define BEEPER_PIN      37
-
-    #define SDPOWER         -1
-	#define SDSS            53
-	#define SD_DETECT_PIN   49
+  #define SD_DETECT_PIN   49
 #endif
 
 #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- 	#undef Z_MIN_PIN
- 	#undef Z_MAX_PIN
-
-	#define Z_MIN_PIN       19 // IND_S_5V
-	#define Z_MAX_PIN       18 // Z-MIN Label
+  #undef Z_MIN_PIN
+  #undef Z_MAX_PIN
+  #define Z_MIN_PIN       19 // IND_S_5V
+  #define Z_MAX_PIN       18 // Z-MIN Label
 #endif
diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h
index 9cdf2f7bfb..ea0bb617bd 100644
--- a/Marlin/pins_RAMBO.h
+++ b/Marlin/pins_RAMBO.h
@@ -82,7 +82,6 @@
 #define E1_MS1_PIN 63
 #define E1_MS2_PIN 64
 
-#undef DIGIPOTSS_PIN
 #define DIGIPOTSS_PIN 38
 #define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping
 
diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h
index 2f21035cf3..3a8062f08b 100644
--- a/Marlin/pins_RAMPS_13.h
+++ b/Marlin/pins_RAMPS_13.h
@@ -8,7 +8,7 @@
  *  RAMPS_13_EFF (Extruder, Fan, Fan)
  *  RAMPS_13_EEF (Extruder, Extruder, Fan)
  *  RAMPS_13_SF  (Spindle, Controller Fan)
- * 
+ *
  *  RAMPS_14_EFB (Extruder, Fan, Bed)
  *  RAMPS_14_EEB (Extruder, Extruder, Bed)
  *  RAMPS_14_EFF (Extruder, Fan, Fan)
-- 
GitLab