From ed9af2ec50bbf8876342ac874aec6c8ff52299ca Mon Sep 17 00:00:00 2001 From: Hakan Bastedt Date: Tue, 9 Apr 2024 20:24:16 +0200 Subject: [PATCH] Reduce irq delay if it has gotten to large --- Firmware/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Firmware/src/main.cpp b/Firmware/src/main.cpp index c963375..67fb91a 100755 --- a/Firmware/src/main.cpp +++ b/Firmware/src/main.cpp @@ -88,6 +88,8 @@ void handleStepper(void) if (irqServeDelays.bufferIsFull()) // Do max calcs, just waiting a second { uint16_t maxInBuffer = irqServeDelays.getMaxInBuffer(); + if (maxIrqServeTime > maxInBuffer) // Reduce by one, slowly eating up excess time + maxIrqServeTime--; if (maxIrqServeTime < maxInBuffer) maxIrqServeTime = maxInBuffer; }