|
@@ -154,6 +154,34 @@
|
154
|
154
|
#define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
|
155
|
155
|
#define E3_ENABLE_READ READ(E3_ENABLE_PIN)
|
156
|
156
|
|
|
157
|
+#if EXTRUDERS > 3
|
|
158
|
+ #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 3:E3_STEP_WRITE(v);break;case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}}
|
|
159
|
+ #define NORM_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(!INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}}
|
|
160
|
+ #define REV_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}}
|
|
161
|
+#elif EXTRUDERS > 2
|
|
162
|
+ #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}}
|
|
163
|
+ #define NORM_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}}
|
|
164
|
+ #define REV_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}}
|
|
165
|
+#elif EXTRUDERS > 1
|
|
166
|
+ #define _E_STEP_WRITE(v) {if(current_block->active_extruder==1){E1_STEP_WRITE(v);}else{E0_STEP_WRITE(v);}}
|
|
167
|
+ #define _NORM_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(!INVERT_E1_DIR);}else{E0_DIR_WRITE(!INVERT_E0_DIR);}}
|
|
168
|
+ #define _REV_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(INVERT_E1_DIR);}else{E0_DIR_WRITE(INVERT_E0_DIR);}}
|
|
169
|
+ #if DISABLED(DUAL_X_CARRIAGE)
|
|
170
|
+ #define E_STEP_WRITE(v) _E_STEP_WRITE(v)
|
|
171
|
+ #define NORM_E_DIR() _NORM_E_DIR()
|
|
172
|
+ #define REV_E_DIR() _REV_E_DIR()
|
|
173
|
+ #else
|
|
174
|
+ extern bool extruder_duplication_enabled;
|
|
175
|
+ #define E_STEP_WRITE(v) {if(extruder_duplication_enabled){E0_STEP_WRITE(v);E1_STEP_WRITE(v);}else _E_STEP_WRITE(v);}
|
|
176
|
+ #define NORM_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(!INVERT_E0_DIR);E1_DIR_WRITE(!INVERT_E1_DIR);}else _NORM_E_DIR();}
|
|
177
|
+ #define REV_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(INVERT_E0_DIR);E1_DIR_WRITE(INVERT_E1_DIR);}else _REV_E_DIR();}
|
|
178
|
+ #endif
|
|
179
|
+#else
|
|
180
|
+ #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
|
|
181
|
+ #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
|
|
182
|
+ #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
|
|
183
|
+#endif
|
|
184
|
+
|
157
|
185
|
//////////////////////////////////
|
158
|
186
|
// Pin redefines for TMC drivers.
|
159
|
187
|
// TMC26X drivers have step and dir on normal pins, but everything else via SPI
|