From 173aa2debad36da6590c53ad0a4114bfcda6a710 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 22 Jun 2020 00:54:50 +0200 Subject: [PATCH] Fix bogus timer check preventing fast LA steps to be scheduled Simplify and fix the broken timer check when scheduling advance ticks. This dates back to the original LA15 PR, an old bug... --- Firmware/stepper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 57520070..b1c3d286 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -1016,7 +1016,7 @@ FORCE_INLINE void advance_isr_scheduler() { // Schedule the next closest tick, ignoring advance if scheduled too // soon in order to avoid skewing the regular stepper acceleration - if (nextAdvanceISR != ADV_NEVER && (nextAdvanceISR + TCNT1 + 40) < nextMainISR) + if (nextAdvanceISR != ADV_NEVER && (nextAdvanceISR + 40) < nextMainISR) OCR1A = nextAdvanceISR; else OCR1A = nextMainISR;