diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-02-11 17:49:47 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-06-09 18:58:35 -0400 |
commit | e1f7748e1a9dfda3e78f8a27e9972a9eb954e946 (patch) | |
tree | 7aebf62cd3a5314f1049175d88344ef67e43dddf /klippy/chelper/__init__.py | |
parent | b6d8cf27d25faecfa47404924a757dc09e7a84a3 (diff) | |
download | kutter-e1f7748e1a9dfda3e78f8a27e9972a9eb954e946.tar.gz kutter-e1f7748e1a9dfda3e78f8a27e9972a9eb954e946.tar.xz kutter-e1f7748e1a9dfda3e78f8a27e9972a9eb954e946.zip |
trdispatch: Support fast responses to trsync_state messages
Add C code that can process trsync_state messages and dispatch
responses with low-latency.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/__init__.py')
-rw-r--r-- | klippy/chelper/__init__.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py index 4a8728fb..7b20963d 100644 --- a/klippy/chelper/__init__.py +++ b/klippy/chelper/__init__.py @@ -18,7 +18,7 @@ COMPILE_ARGS = ("-Wall -g -O2 -shared -fPIC" SSE_FLAGS = "-mfpmath=sse -msse2" SOURCE_FILES = [ 'pyhelper.c', 'serialqueue.c', 'stepcompress.c', 'itersolve.c', 'trapq.c', - 'pollreactor.c', 'msgblock.c', + 'pollreactor.c', 'msgblock.c', 'trdispatch.c', 'kin_cartesian.c', 'kin_corexy.c', 'kin_corexz.c', 'kin_delta.c', 'kin_polar.c', 'kin_rotary_delta.c', 'kin_winch.c', 'kin_extruder.c', 'kin_shaper.c', @@ -168,6 +168,19 @@ defs_serialqueue = """ , struct pull_queue_message *q, int max); """ +defs_trdispatch = """ + void trdispatch_start(struct trdispatch *td, uint32_t dispatch_reason); + void trdispatch_stop(struct trdispatch *td); + struct trdispatch *trdispatch_alloc(void); + struct trdispatch_mcu *trdispatch_mcu_alloc(struct trdispatch *td + , struct serialqueue *sq, struct command_queue *cq, uint32_t trsync_oid + , uint32_t set_timeout_msgtag, uint32_t trigger_msgtag + , uint32_t state_msgtag); + void trdispatch_mcu_setup(struct trdispatch_mcu *tdm + , uint64_t last_status_clock, uint64_t expire_clock + , uint64_t expire_ticks, uint64_t min_extend_ticks); +""" + defs_pyhelper = """ void set_python_logging_callback(void (*func)(const char *)); double get_monotonic(void); @@ -179,9 +192,10 @@ defs_std = """ defs_all = [ defs_pyhelper, defs_serialqueue, defs_std, defs_stepcompress, - defs_itersolve, defs_trapq, defs_kin_cartesian, defs_kin_corexy, - defs_kin_corexz, defs_kin_delta, defs_kin_polar, defs_kin_rotary_delta, - defs_kin_winch, defs_kin_extruder, defs_kin_shaper, + defs_itersolve, defs_trapq, defs_trdispatch, + defs_kin_cartesian, defs_kin_corexy, defs_kin_corexz, defs_kin_delta, + defs_kin_polar, defs_kin_rotary_delta, defs_kin_winch, defs_kin_extruder, + defs_kin_shaper, ] # Update filenames to an absolute path |