The TIMER_IDLE_REPEAT_TICKS was intended to reduce the number of cases
where timers would defer to tasks when tasks are mostly idle.
However, with commit ea546c78 this became less important because
timers now only defer to tasks if tasks are consistently busy for two
consecutive calls to sched_check_set_tasks_busy().
The TIMER_IDLE_REPEAT_TICKS mechanism could result in extended task
delays if timers do become busy. Timers can become busy in normal
operation if timers are scheduled to run more than 500,000 times a
second (every 2us or faster). This can occur on stepper movement when
using high microstep settings. If timers become busy, it could take
up to 1ms for tasks to next be given an opportunity to run (two calls
to sched_check_set_tasks_busy() at 500us per call). This wouldn't
typically be an issue if tasks are also busy, but in some loads tasks
may need to run periodically in such a way that the task status
alternates between idle and busy. In this case, the
TIMER_IDLE_REPEAT_TICKS mechanism could effectively limit the number
of task wakeups to only ~1000 per second.
The "USB to canbus bridge" code uses tasks to transfer data to/from
USB and canbus. If timers become busy, the limiting of task wakeups
could lead to a situation where the effective bandwidth becomes
severely constrained. In particular, this can be an issue on USB
implementations that do not support "double buffering" (such as the
stm32 usbotg code). There are reports of "Timer too close" errors on
"USB to canbus bridge" mode as a result of this issue.
Fix by removing the TIMER_IDLE_REPEAT_TICKS check. Check for busy
tasks every TIMER_REPEAT_TICKS instead (100us).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
- Document AHT15 and AHT30 sensor support
- Update sensor_type options (AHT1X, AHT2X, AHT3X)
- Add note about some AHT20 working with AHT1X sensor type
Signed-off-by: Lev Voronov <minicx@disroot.org>
This also enables arbitrary using names for primary carriages
with generic_cartesian kinematics.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* Do not recommend ZV shaper by default if possible
* Try to find more optimal shaper out of more aggressive ones
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This adds a dedicated check for that case to be able to
find the root cause of a misconfiguration earlier.
Also, replace occurrences of hardcoded max tick count.
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
This timing is also known as T1H in various datasheets. Increasing it
should improve compatibility with various revisions and clones of the
WS2812 LED.
The short version is that 800 is the timing used by Adafruit's popular
NeoPixel Arduino library, and it has no problem driving my BTT RGBW kit
LEDs, while Klipper cannot drive them properly without this patch. The
real upper limit to this value is something like 5000ns so increasing
it should not cause new compatibility problems for LEDs that currently
work.
Signed-off-by: Alistair Buxton <a.j.buxton@gmail.com>
A "dummy extruder" that is created when no "[extruder]" config section
is defined does not have a "name". Avoid reporting that empty name in
the `{printer.toolhead.extra_axes}" status report.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the "position" status to include extra axes. Export a new
"extra_axes" value that describes the class associated with each
component of the coordinate.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change "homing_origin" and "position" to support more than 4
components. Export a new "axis_map" value to describe the contents at
each component index.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Instead of passing arguments as parameters, pass them as a list (or
tuple). This simplifies the callers and makes it easier to pass
additional parameters.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Keep moving messages from the pending queues to the ready queues even
if it's not currently valid to transmit messages to the mcu. This
improves the statistics when debugging.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Only hold the lock in the serialqueue thread when moving messages to
the ready queue and when setting the next need_kick_clock.
Only set the need_kick_clock just prior to sleeping.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Maintain the next needed wakeup time for entries in the pending
queues. This avoids needing to walk the upcoming queues when it is
known that nothing is ready to be released.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There's no reason to attempt to handle multiple buffer transmissions
in a single command_event() call. Handle the transmit case outside of
the command building loop.
If data is transmitted, then get a new timestamp from the pollreactor
and retry before sleeping.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Simply describe how the cmdqueue is moved between states.
This is commit d7da45e1 resubmitted with a slighly different
implementation. It is thought that the previous implementation was
causing a gcc compiliation issue on gcc v12.0-v12.4 compilers. (It
may be related to gcc bug report 107467).
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 3f7d05dd attempted to add support for transmitting RTR and EFF
frames to stm32/can.c , but the change was incomplete.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This reverts commit aea8d8e0a1.
This reverts commit 493271697f.
This reverts commit d7da45e152.
There are reports of a regression since making this change. Revert
for now until the root cause can be found.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This is the only user of the i2c_write inside the init
compatibility layer, so remove it as well.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Update functions could be called within the flush/lookahead context
If the update function internally does pause()
That would lead to the unpredictable execution of time-critical functions
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>