Commit Graph

5995 Commits

Author SHA1 Message Date
Kevin O'Connor
f04895f540 docs: Update Config_Changes.md with recent coordinate changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:21:19 -05:00
Kevin O'Connor
c7b1e401f0 docs: Update Status_Reference.md with information on accessing coordinates
Update the docs with information on how to access the "extra axes" of
coordinate values.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
c3bf7b109e motion_report: Support reporting live_position of extra axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
24a1116c7c motion_report: Support reporting of manual_stepper trapqs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
67db551be5 toolhead: Export "extra axes" coordinates in status
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>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
ac6cab9168 gcode_move: Export extra axes in status reference
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>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
d0b1b832dd gcode: Change Coord() class to initialize from a list or tuple
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>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
01b3a6a8e4 gcode: Replace Coord named tuple with custom tuple class
Replace the existing Coord() class with one that supports more than 4
coordinates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
b6c1b5a6dd serialqueue: Minor simplification in serialqueue_extract_old()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 12:35:26 -05:00
Kevin O'Connor
35dffc1516 serialqueue: Rework check_wake_receive() to receive_append_wake()
Rename the function and perform list appending and locking in that
function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
459e77c4f9 serialqueue: Keep moving messages from pending queues to ready queues
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>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
804a9d11e8 serialqueue: Reduce time transmit_requests lock is held
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>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
bfb627c3d0 serialqueue: Cache min_release_clock in pending queues
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>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
cfb616664e serialqueue: Introduce new check_upcoming_queues() internal function
Move the upcoming queue movement logic to a new function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
d453ab3d19 serialqueue: Simplify command_event()
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>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
7634773cf1 serialqueue: Move definition of transmit_requests in serialqueue
Move the definition of the struct so that it is more clear that it has
its own locking.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 12:15:37 -05:00
Timofey Titovets
46af133613 serialqueue: decouple transmit requests
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-04 12:15:37 -05:00
Timofey Titovets
4a00e4b0ec serialqueue: decouple serialhdl receive lock
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-04 12:15:37 -05:00
Kevin O'Connor
877b63a28c docs: Fix minor typo in Eddy_Probe.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 10:58:36 -05:00
Kevin O'Connor
05c4a38279 docs: Fix minor typo in Eddy_Probe.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-04 10:57:27 -05:00
Timofey Titovets
ba79d72fb4 serialqueue: decouple pending & ready queues
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>
2025-10-30 20:16:25 -04:00
Kevin O'Connor
99c0bfca4f stm32: Fix RTR and EFF canbus tx requests in can.c
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>
2025-10-27 12:22:38 -04:00
Kevin O'Connor
6465921a5a gcode_macro: Verify nothing attempts to pause in a get_status() callback
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Kevin O'Connor
ff667075cf statistics: Verify nothing attempts to pause in a stats() callback
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Kevin O'Connor
7a723bdc1c serialqueue: Revert recent serialqueue locking changes
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>
2025-10-18 19:47:53 -04:00
Timofey Titovets
bb04546e6e pca9533: do write on connect like pca9632 does
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>
2025-10-18 13:46:58 -04:00
Timofey Titovets
6a8b823a45 led: run update function as reactor callback
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>
2025-10-18 13:46:58 -04:00
Timofey Titovets
aea8d8e0a1 serialqueue: decouple transmit requests
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:20:58 -04:00
Timofey Titovets
493271697f serialqueue: decouple serialhdl receive lock
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:20:58 -04:00
Timofey Titovets
d7da45e152 serialqueue: decouple pending & ready queues
Simply describe how the cmdqueue is moved between states.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:20:58 -04:00
Kevin O'Connor
7a036a6ba7 toolhead: Verify nothing attempts to pause in lookahead callbacks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
6557050968 motion_queuing: Verify nothing attempts to pause in flush callbacks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
302df255db klippy: Verify nothing attempts to pause in the klippy:ready event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
e549cc4143 load_cell: Only launch a callback in the klippy:ready event handler
It is not valid to pause in the klippy:ready callback, so perform the
sensor startup process in a separate reactor task.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
0e7e908af4 klippy: Verify nothing attempts to pause in the klippy:shutdown event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:02 -04:00
Kevin O'Connor
d1c0cbd63a reactor: Add support for temporarily disabling reactor pauses
Add a new reactor.assert_no_pause() helper that can temporarily
disable reactor pause requests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:26:37 -04:00
Kevin O'Connor
e96a944f33 mcu: It is not necessary to export an is_shutdown() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
0d0d3917c9 motion_report: Simplify shutdown_clock tracking
Determine which mcu raised the shutdown from the shutdown details
report.  Also, pass shutdown_clock via that details report.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
1bba59b7a0 motion_report: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
bc27bd9a13 mcu: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
54d2716bdd webhooks: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
6f5ab8d0e8 gcode: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
c64c5e891c virtual_sdcard: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
e672391dbc gcode_move: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
38b286db4b error_mcu: Report reactor stats in error_mcu module
Move reactor debugging info from main klippy.py code to error_mcu code
for improved exception handling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
f147804d97 error_mcu: Rename "klippy:notify_mcu_shutdown" to "klippy:analyze_shutdown"
Rename the event to make it a little more clear what it is intended
for.  Also, check for an exception in each event handler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
3215e3a2aa motion_report: Improve "motion_report/dump_stepper" during homing
Step timing is reset when stepper.set_position() is called.  Detect
that case and ensure future steps after set_position start on a new
block.  This simplifies the timing for users of the data.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:12:45 -04:00
Kevin O'Connor
95b0ebf4c7 motion_report: Improve "motion_report/dump_trapq" during homing
Now that trapq_extract_old() can return upcoming moves, it's possible
for homing to cause confusing results (as these moves can end early).
Avoid this by delaying query responses until after homing completes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:12:45 -04:00
Kevin O'Connor
3fe594ef20 sensor_lis2dw: Read 8 samples at a time from sensor fifo
Batch reading of 8 samples (48 bytes) at a time from the sensor.  This
reduces the number of transactions - which can notably improve
performance on i2c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-13 20:36:11 -04:00
JamesH1978
b1dd6a73f7 docs: Update FAQ.md - Typo (#7089)
Kliper is not Klipper!

Signed-off-by: James Hartley <james@hartleyns.com>
2025-10-13 13:53:13 -04:00