aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/stepcompress.c
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/stepcompress.c')
-rw-r--r--klippy/stepcompress.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c
index b00dd7c3..732afe99 100644
--- a/klippy/stepcompress.c
+++ b/klippy/stepcompress.c
@@ -290,6 +290,17 @@ stepcompress_alloc(uint32_t max_error, uint32_t queue_step_msgid
return sc;
}
+// Free memory associated with a 'stepcompress' object
+void
+stepcompress_free(struct stepcompress *sc)
+{
+ if (!sc)
+ return;
+ free(sc->queue);
+ message_queue_free(&sc->msg_queue);
+ free(sc);
+}
+
// Convert previously scheduled steps into commands for the mcu
static void
stepcompress_flush(struct stepcompress *sc, uint64_t move_clock)
@@ -573,6 +584,18 @@ steppersync_alloc(struct serialqueue *sq, struct stepcompress **sc_list
return ss;
}
+// Free memory associated with a 'steppersync' object
+void
+steppersync_free(struct steppersync *ss)
+{
+ if (!ss)
+ return;
+ free(ss->sc_list);
+ free(ss->move_clocks);
+ serialqueue_free_commandqueue(ss->cq);
+ free(ss);
+}
+
// Implement a binary heap algorithm to track when the next available
// 'struct move' in the mcu will be available
static void