From f37a65ca36d6039aa71d80d6bbc88a0747550d81 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Wed, 27 Nov 2013 20:01:32 +0100 Subject: [PATCH] dda_queue.c: run every queued thing through dda_create(). This allows dda_create() to track things queued but not being a movement. Important for lookahead. --- dda.c | 5 ++++- dda_queue.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dda.c b/dda.c index a1fed05..6d4df90 100644 --- a/dda.c +++ b/dda.c @@ -91,10 +91,13 @@ void dda_create(DDA *dda, TARGET *target) { static uint8_t idcnt = 0; static DDA* prev_dda = NULL; - if (prev_dda && prev_dda->done) + if ((prev_dda && prev_dda->done) || dda->waitfor_temp) prev_dda = NULL; #endif + if (dda->waitfor_temp) + return; + // initialise DDA to a known state dda->allflags = 0; diff --git a/dda_queue.c b/dda_queue.c index d433d47..25a06a8 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -114,15 +114,14 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) { DDA* new_movebuffer = &(movebuffer[h]); if (t != NULL) { - dda_create(new_movebuffer, t); new_movebuffer->endstop_check = endstop_check; new_movebuffer->endstop_stop_cond = endstop_stop_cond; } else { // it's a wait for temp new_movebuffer->waitfor_temp = 1; - new_movebuffer->nullmove = 0; } + dda_create(new_movebuffer, t); // make certain all writes to global memory // are flushed before modifying mb_head.