Fix switching extruder stepping with LA

This commit is contained in:
Scott Lahteine 2018-05-26 19:06:49 -05:00
parent 05fc761929
commit 6775a16c97

View file

@ -1797,26 +1797,26 @@ uint32_t Stepper::stepper_block_phase_isr() {
#elif ENABLED(SWITCHING_EXTRUDER) #elif ENABLED(SWITCHING_EXTRUDER)
#if EXTRUDERS > 4 #if EXTRUDERS > 4
#define START_E_PULSE(INDEX) do{ if (e_steps) { switch (INDEX) { \ #define START_E_PULSE(INDEX) do{ if (e_steps) { switch (INDEX) { \
case 0: case 1: E0_DIR_WRITE(!INVERT_E_STEP_PIN); break; \ case 0: case 1: E0_STEP_WRITE(!INVERT_E_STEP_PIN); break; \
case 2: case 3: E1_DIR_WRITE(!INVERT_E_STEP_PIN); break; \ case 2: case 3: E1_STEP_WRITE(!INVERT_E_STEP_PIN); break; \
case 4: E2_DIR_WRITE(!INVERT_E_STEP_PIN); } \ case 4: E2_STEP_WRITE(!INVERT_E_STEP_PIN); } \
} }while(0) } }while(0)
#define STOP_E_PULSE(INDEX) do{ if (e_steps) { \ #define STOP_E_PULSE(INDEX) do{ if (e_steps) { \
e_steps < 0 ? ++e_steps : --e_steps; \ e_steps < 0 ? ++e_steps : --e_steps; \
switch (INDEX) { \ switch (INDEX) { \
case 0: case 1: E0_DIR_WRITE(INVERT_E_STEP_PIN); break; \ case 0: case 1: E0_STEP_WRITE( INVERT_E_STEP_PIN); break; \
case 2: case 3: E1_DIR_WRITE(INVERT_E_STEP_PIN); break; \ case 2: case 3: E1_STEP_WRITE( INVERT_E_STEP_PIN); break; \
case 4: E2_DIR_WRITE(INVERT_E_STEP_PIN); } \ case 4: E2_STEP_WRITE( INVERT_E_STEP_PIN); } \
} }while(0) } }while(0)
#elif EXTRUDERS > 2 #elif EXTRUDERS > 2
#define START_E_PULSE(INDEX) do{ if (e_steps) { if (INDEX < 2) E0_DIR_WRITE(!INVERT_E_STEP_PIN); else E1_DIR_WRITE(!INVERT_E_STEP_PIN); } }while(0) #define START_E_PULSE(INDEX) do{ if (e_steps) { if (INDEX < 2) E0_STEP_WRITE(!INVERT_E_STEP_PIN); else E1_STEP_WRITE(!INVERT_E_STEP_PIN); } }while(0)
#define STOP_E_PULSE(INDEX) do{ if (e_steps) { \ #define STOP_E_PULSE(INDEX) do{ if (e_steps) { \
e_steps < 0 ? ++e_steps : --e_steps; \ e_steps < 0 ? ++e_steps : --e_steps; \
if (INDEX < 2) E0_DIR_WRITE(INVERT_E_STEP_PIN); else E1_DIR_WRITE(INVERT_E_STEP_PIN); \ if (INDEX < 2) E0_STEP_WRITE(INVERT_E_STEP_PIN); else E1_STEP_WRITE(INVERT_E_STEP_PIN); \
} }while(0) } }while(0)
#else #else
#define START_E_PULSE(INDEX) do{ if (e_steps) E0_DIR_WRITE(!INVERT_E_STEP_PIN); }while(0) #define START_E_PULSE(INDEX) do{ if (e_steps) E0_STEP_WRITE(!INVERT_E_STEP_PIN); }while(0)
#define STOP_E_PULSE(INDEX) do{ if (e_steps) { e_steps < 0 ? ++e_steps : --e_steps; E0_DIR_WRITE(INVERT_E_STEP_PIN); }while(0) #define STOP_E_PULSE(INDEX) do{ if (e_steps) { e_steps < 0 ? ++e_steps : --e_steps; E0_STEP_WRITE(INVERT_E_STEP_PIN); }while(0)
#endif #endif
#else #else
#define START_E_PULSE(INDEX) do{ if (e_steps) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); }while(0) #define START_E_PULSE(INDEX) do{ if (e_steps) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); }while(0)