aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/trapq.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-10-27 18:50:53 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-11-06 15:51:51 -0500
commitd3afe4f1d89a13af4ef7c3ceb024dfae0edf3369 (patch)
tree50b69e8844edf1667e68caf90165b6254af55589 /klippy/chelper/trapq.h
parentc06f6943a66cff3fa20e570edc8f2aff235ae75e (diff)
downloadkutter-d3afe4f1d89a13af4ef7c3ceb024dfae0edf3369.tar.gz
kutter-d3afe4f1d89a13af4ef7c3ceb024dfae0edf3369.tar.xz
kutter-d3afe4f1d89a13af4ef7c3ceb024dfae0edf3369.zip
trapq: Initial support for building a queue of trapezoidal velocity moves
Add support for building a list of moves in the trapq.c code. Update the toolhead code so that moves generated from the look-ahead code are added to that list. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/trapq.h')
-rw-r--r--klippy/chelper/trapq.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/klippy/chelper/trapq.h b/klippy/chelper/trapq.h
index 15d7b44c..e568a1ab 100644
--- a/klippy/chelper/trapq.h
+++ b/klippy/chelper/trapq.h
@@ -1,6 +1,8 @@
#ifndef TRAPQ_H
#define TRAPQ_H
+#include "list.h" // list_node
+
struct coord {
double x, y, z;
};
@@ -16,6 +18,8 @@ struct move {
double cruise_v;
struct move_accel accel, decel;
struct coord start_pos, axes_r;
+
+ struct list_node node;
};
struct move *move_alloc(void);
@@ -27,4 +31,13 @@ void move_fill(struct move *m, double print_time
double move_get_distance(struct move *m, double move_time);
struct coord move_get_coord(struct move *m, double move_time);
+struct trapq {
+ struct list_head moves;
+};
+
+struct trapq *trapq_alloc(void);
+void trapq_free(struct trapq *tq);
+void trapq_add_move(struct trapq *tq, struct move *m);
+void trapq_free_moves(struct trapq *tq, double print_time);
+
#endif // trapq.h