Patch LIN_ADVANCE timing issue
Also the extruder stepper ISR has to keep an eye on step_loops count.
This commit is contained in:
parent
f30df89ee1
commit
0c5192b288
@ -451,7 +451,7 @@ void Stepper::isr() {
|
|||||||
#endif // ADVANCE or LIN_ADVANCE
|
#endif // ADVANCE or LIN_ADVANCE
|
||||||
|
|
||||||
#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
|
#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
|
||||||
eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]);
|
eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
|
else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
|
||||||
@ -487,7 +487,7 @@ void Stepper::isr() {
|
|||||||
#endif // ADVANCE or LIN_ADVANCE
|
#endif // ADVANCE or LIN_ADVANCE
|
||||||
|
|
||||||
#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
|
#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
|
||||||
eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]);
|
eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -497,7 +497,7 @@ void Stepper::isr() {
|
|||||||
if (current_block->use_advance_lead)
|
if (current_block->use_advance_lead)
|
||||||
current_estep_rate[current_block->active_extruder] = final_estep_rate;
|
current_estep_rate[current_block->active_extruder] = final_estep_rate;
|
||||||
|
|
||||||
eISR_Rate = (OCR1A_nominal >> 2) / abs(e_steps[current_block->active_extruder]);
|
eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[current_block->active_extruder]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -542,6 +542,7 @@ void Stepper::isr() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Step all E steppers that have steps
|
// Step all E steppers that have steps
|
||||||
|
for (uint8_t i = 0; i < step_loops; i++) {
|
||||||
STEP_E_ONCE(0);
|
STEP_E_ONCE(0);
|
||||||
#if EXTRUDERS > 1
|
#if EXTRUDERS > 1
|
||||||
STEP_E_ONCE(1);
|
STEP_E_ONCE(1);
|
||||||
@ -552,6 +553,7 @@ void Stepper::isr() {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user