Support duplication mode in LIN_ADVANCE
This commit is contained in:
parent
b08ec22fe1
commit
8291ae34f2
@ -755,23 +755,21 @@ void Stepper::isr() {
|
|||||||
|
|
||||||
void Stepper::advance_isr() {
|
void Stepper::advance_isr() {
|
||||||
|
|
||||||
#if ENABLED(MK2_MULTIPLEXER)
|
#if ENABLED(MK2_MULTIPLEXER) // For SNMM even-numbered steppers are reversed
|
||||||
// Even-numbered steppers are reversed
|
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? !INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0) : INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0)); }while(0)
|
||||||
#define SET_E_STEP_DIR(INDEX) \
|
#elif ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||||
if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? !INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0) : INVERT_E## INDEX ##_DIR ^ TEST(INDEX, 0))
|
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
|
||||||
#else
|
#else
|
||||||
#define SET_E_STEP_DIR(INDEX) \
|
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR); }while(0)
|
||||||
if (e_steps) E## INDEX ##_DIR_WRITE(e_steps < 0 ? INVERT_E## INDEX ##_DIR : !INVERT_E## INDEX ##_DIR)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define START_E_PULSE(INDEX) \
|
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||||
if (e_steps) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN)
|
#define START_E_PULSE(INDEX) do{ if (e_steps) E_STEP_WRITE(!INVERT_E_STEP_PIN); }while(0)
|
||||||
|
#define STOP_E_PULSE(INDEX) do{ if (e_steps) { E_STEP_WRITE(INVERT_E_STEP_PIN); e_steps < 0 ? ++e_steps : --e_steps; } }while(0)
|
||||||
#define STOP_E_PULSE(INDEX) \
|
#else
|
||||||
if (e_steps) { \
|
#define START_E_PULSE(INDEX) do{ if (e_steps) E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); }while(0)
|
||||||
e_steps < 0 ? ++e_steps : --e_steps; \
|
#define STOP_E_PULSE(INDEX) do { if (e_steps) { E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); e_steps < 0 ? ++e_steps : --e_steps; } }while(0)
|
||||||
E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
if (current_block->use_advance_lead) {
|
if (current_block->use_advance_lead) {
|
||||||
if (step_events_completed > LA_decelerate_after && current_adv_steps > final_adv_steps) {
|
if (step_events_completed > LA_decelerate_after && current_adv_steps > final_adv_steps) {
|
||||||
@ -793,7 +791,7 @@ void Stepper::isr() {
|
|||||||
else
|
else
|
||||||
nextAdvanceISR = ADV_NEVER;
|
nextAdvanceISR = ADV_NEVER;
|
||||||
|
|
||||||
switch(LA_active_extruder) {
|
switch (LA_active_extruder) {
|
||||||
case 0: SET_E_STEP_DIR(0); break;
|
case 0: SET_E_STEP_DIR(0); break;
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
case 1: SET_E_STEP_DIR(1); break;
|
case 1: SET_E_STEP_DIR(1); break;
|
||||||
@ -816,7 +814,7 @@ void Stepper::isr() {
|
|||||||
hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM);
|
hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(LA_active_extruder) {
|
switch (LA_active_extruder) {
|
||||||
case 0: START_E_PULSE(0); break;
|
case 0: START_E_PULSE(0); break;
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
case 1: START_E_PULSE(1); break;
|
case 1: START_E_PULSE(1); break;
|
||||||
@ -840,7 +838,7 @@ void Stepper::isr() {
|
|||||||
DELAY_NOPS(EXTRA_CYCLES_E);
|
DELAY_NOPS(EXTRA_CYCLES_E);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(LA_active_extruder) {
|
switch (LA_active_extruder) {
|
||||||
case 0: STOP_E_PULSE(0); break;
|
case 0: STOP_E_PULSE(0); break;
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
case 1: STOP_E_PULSE(1); break;
|
case 1: STOP_E_PULSE(1); break;
|
||||||
|
Loading…
Reference in New Issue
Block a user