Browse Source

Fix case light logic on Azteeg_X3 boards.

Bob-the-Kuhn 7 years ago
parent
commit
9a9bbfc57c
3 changed files with 14 additions and 19 deletions
  1. 5
    7
      Marlin/pins_AZTEEG_X3.h
  2. 8
    10
      Marlin/pins_AZTEEG_X3_PRO.h
  3. 1
    2
      Marlin/pins_RAMPS.h

+ 5
- 7
Marlin/pins_AZTEEG_X3.h View File

@@ -32,11 +32,10 @@
32 32
   #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue."
33 33
 #endif
34 34
 
35
-#define BOARD_NAME "Azteeg X3"
36
-
37
-#if !PIN_EXISTS(CASE_LIGHT)         // doesn't already exist so OK to change the definition coming
38
-  #define OK_TO_CHANGE_CASE_LIGHT   // in from from the include file
35
+#if ENABLED(CASE_LIGHT_ENABLE)  && !PIN_EXISTS(CASE_LIGHT)
36
+  #define CASE_LIGHT_PIN 6     // must define it here or else RAMPS will define it
39 37
 #endif
38
+#define BOARD_NAME "Azteeg X3"
40 39
 
41 40
 #include "pins_RAMPS_13.h"
42 41
 
@@ -75,10 +74,8 @@
75 74
 //
76 75
 // Misc
77 76
 //
78
-#if ENABLED(OK_TO_CHANGE_CASE_LIGHT) && STAT_LED_RED_PIN == 6
77
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN 
79 78
   #undef STAT_LED_RED_PIN
80
-  #undef CASE_LIGHT_PIN
81
-  #define CASE_LIGHT_PIN 6  // open collector FET driver
82 79
 #endif
83 80
 
84 81
 //
@@ -94,6 +91,7 @@
94 91
   #if SERVO0_PIN == 7
95 92
     #undef SERVO0_PIN
96 93
     #def SERVO0_PIN 11
94
+  #endif
97 95
   #define SPINDLE_LASER_PWM_PIN     7  // MUST BE HARDWARE PWM
98 96
   #define SPINDLE_LASER_ENABLE_PIN 20  // Pin should have a pullup!
99 97
   #define SPINDLE_DIR_PIN          21

+ 8
- 10
Marlin/pins_AZTEEG_X3_PRO.h View File

@@ -28,12 +28,13 @@
28 28
   #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue."
29 29
 #endif
30 30
 
31
-#define BOARD_NAME "Azteeg X3 Pro"
32
-
33
-#if !PIN_EXISTS(CASE_LIGHT)         // doesn't already exist so OK to change the definition coming
34
-  #define OK_TO_CHANGE_CASE_LIGHT   // in from from the include file
31
+#if ENABLED(CASE_LIGHT_ENABLE)  && !PIN_EXISTS(CASE_LIGHT)
32
+  #define CASE_LIGHT_PIN 44     // must define it here or else RAMPS will define it
35 33
 #endif
36 34
 
35
+
36
+#define BOARD_NAME "Azteeg X3 Pro"
37
+
37 38
 #include "pins_RAMPS.h"
38 39
 
39 40
 #ifndef __AVR_ATmega2560__
@@ -144,19 +145,16 @@
144 145
 //
145 146
 // Misc. Functions
146 147
 //
147
-#if ENABLED(OK_TO_CHANGE_CASE_LIGHT)
148
+#if ENABLED(CASE_LIGHT_ENABLE)  && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN 
148 149
   #undef DOGLCD_A0            // steal pin 44 for the case light; if you have a Viki2 and have connected it
149 150
   #define DOGLCD_A0      57   // following the Panucatt wiring diagram, you may need to tweak these pin assignments
150
-                              // as the wiring diagram uses pin 44 for DOGLCD_A0
151
-
152
-  #undef CASE_LIGHT_PIN
153
-  #define CASE_LIGHT_PIN 44    // must have a hardware PWM
151
+                                // as the wiring diagram uses pin 44 for DOGLCD_A0
154 152
 #endif
155 153
 
156 154
 //
157 155
 // M3/M4/M5 - Spindle/Laser Control
158 156
 //
159
-#undef SPINDLE_LASER_PWM_PIN    // Definitions in pins_RAMPS.h are no good with the AzteegX3 board
157
+#undef SPINDLE_LASER_PWM_PIN    // Definitions in pins_RAMPS.h are no good with the AzteegX3pro board
160 158
 #undef SPINDLE_LASER_ENABLE_PIN
161 159
 #undef SPINDLE_DIR_PIN
162 160
 

+ 1
- 2
Marlin/pins_RAMPS.h View File

@@ -204,8 +204,7 @@
204 204
 
205 205
 #define PS_ON_PIN          12
206 206
 
207
-#if !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
208
-  #undef CASE_LIGHT_PIN
207
+#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
209 208
   #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
210 209
     #define CASE_LIGHT_PIN   6      // MUST BE HARDWARE PWM
211 210
   #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \

Loading…
Cancel
Save