Use the existing register_flush_callback() system to implement motor
activity checking. This simplifies the generate_steps() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allocate the low-level C stepcompress object in the motion_queuing
module. This simplifies the mcu.py code as it no longer needs to
track the stepqueues for the steppersync object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change note_mcu_movequeue_activity() to default to setting the
step_gen_time (instead of the previous default to not set it).
Most users of the mcu "move queue" will be for stepper activity.
There is also little harm in incrementing the tracking of the last
possible step generation time, but accidentally generating a step
without incrementing the tracking can lead to very hard to debug
failures.
The two cases (output_pin.py and pwm_tool.py) where
note_mcu_movequeue_activity() is called and definitely not related to
step generation can explicitly pass 'is_step_gen=False'.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There is no harm in enabling flushing for a little longer than
necessary. In contrast, a slight rounding issue causing a message to
not get flushed properly could result in an error. So, extend the
flushing time slightly to avoid potential issues.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Call toolhead.note_kinematic_activity() on each pin update to ensure
that those updates will be flushed properly.
This fixes "Timer too close" errors on SET_PIN commands that are
issued when the toolhead is idle.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The output_pin module is only capable of updating an output pin at
most once every 100ms. Add a new pwm_tool module that is capable of
queuing updates in the micro-controller and thus allowing for much
higher update rates.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>