FluidNC
FluidNC copied to clipboard
Prevent underflow when recalculating an empty planner buffer
planner_recalculate did not check for an empty planner buffer.
This change adds an early exit guard.
I discovered the issue by calling protocol_send_event(&feedOverrideEvent, -FeedOverride::CoarseIncrement) every 10ms resulting in Stepper::get_realtime_rate() returning NaN due to a negative max_entry_speed_sqr being used in replanning.
The extent of the stress testing I have done is to run with the fix for about ten minutes.