chiark / gitweb /
Only protect the heater pins for the defined extruders.
authorDaid <daid303@gmail.com>
Wed, 29 Feb 2012 14:49:02 +0000 (15:49 +0100)
committerDaid <daid303@gmail.com>
Wed, 29 Feb 2012 14:49:02 +0000 (15:49 +0100)
Changed the way the extruder pins are defined so it doesn't create extra -1 entries in the list.

Marlin/pins.h

index fb809ce5838a32e0997e74983de0b79458e6443e..1210800c18189a6d225e1c0085b8fda18b40887a 100644 (file)
 #endif
 
 //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN
-#if EXTRUDERS == 3
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
-  #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN
-#elif EXTRUDERS == 2
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
-  #define _E2_PINS -1
-#elif EXTRUDERS == 1
-  #define _E1_PINS -1 
-  #define _E2_PINS -1
+#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, 
+#if EXTRUDERS > 1
+  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
 #else
-  #error Unsupported number of extruders
+  #define _E1_PINS
 #endif
+#elif EXTRUDERS > 2
+  #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
+#else
+  #define _E2_PINS
+#endif
+
 #define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, LED_PIN, PS_ON_PIN, \
-                        HEATER_0_PIN, HEATER_1_PIN, HEATER_2_PIN, \
                         HEATER_BED_PIN, FAN_PIN,                  \
-                        _E0_PINS, _E1_PINS, _E2_PINS,             \
+                        _E0_PINS _E1_PINS _E2_PINS             \
                         TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }
 #endif