diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-02-04 10:07:13 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-06-09 18:58:35 -0400 |
commit | 05c2d51a1239a13a7dfeec9cfbb1ea38b7b32aa0 (patch) | |
tree | 38af27b15aba3edabc744fa7483e643ec8c028f3 /src/trsync.h | |
parent | f3bd4e6acffadb4e927f69d3944da92579707a4b (diff) | |
download | kutter-05c2d51a1239a13a7dfeec9cfbb1ea38b7b32aa0.tar.gz kutter-05c2d51a1239a13a7dfeec9cfbb1ea38b7b32aa0.tar.xz kutter-05c2d51a1239a13a7dfeec9cfbb1ea38b7b32aa0.zip |
trsync: Introduce new "trigger synchronization" support
Separate out the stepper stopping code from endstop.c into its own
trsync.c code file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/trsync.h')
-rw-r--r-- | src/trsync.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/trsync.h b/src/trsync.h new file mode 100644 index 00000000..c7cc9b54 --- /dev/null +++ b/src/trsync.h @@ -0,0 +1,19 @@ +#ifndef __TRSYNC_H +#define __TRSYNC_H + +#include <stdint.h> // uint16_t + +struct trsync_signal; +typedef void (*trsync_callback_t)(struct trsync_signal *tss, uint8_t reason); + +struct trsync_signal { + struct trsync_signal *next; + trsync_callback_t func; +}; + +struct trsync *trsync_oid_lookup(uint8_t oid); +void trsync_do_trigger(struct trsync *ts, uint8_t reason); +void trsync_add_signal(struct trsync *ts, struct trsync_signal *tss + , trsync_callback_t func); + +#endif // trsync.h |