Reduce irq delay if it has gotten to large

This commit is contained in:
Hakan Bastedt
2024-04-09 20:24:16 +02:00
parent 939470a0c6
commit ed9af2ec50

View File

@@ -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;
}