Recalculate LA_phase correctly

This commit is contained in:
Yuri D'Elia 2019-05-26 17:05:47 +02:00
parent 3abb2188df
commit 9d834925c0

View File

@ -816,8 +816,9 @@ FORCE_INLINE void isr() {
deceleration_time += timer; deceleration_time += timer;
#ifdef LIN_ADVANCE #ifdef LIN_ADVANCE
if (current_block->use_advance_lead) { if (current_block->use_advance_lead) {
la_state = ADV_DECELERATE;
if (step_events_completed.wide <= (unsigned long int)current_block->decelerate_after + step_loops) if (step_events_completed.wide <= (unsigned long int)current_block->decelerate_after + step_loops)
la_state = ADV_INIT | ADV_DECELERATE; la_state |= ADV_INIT;
} }
#endif #endif
} }