From 95a44e877791d6e7cbafe44e6b4edc07cdef6258 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 16 Dec 2013 13:48:00 +0100 Subject: [PATCH] DDA: clear flags of a queue entry earlier. Formerly, once a wait for temp was given, this flag would stick forever on this queue entry. Spotted by Zungmann, thanks a lot! http://forums.reprap.org/read.php?147,33082,280439#msg-280439 --- dda.c | 5 ----- dda_queue.c | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dda.c b/dda.c index 5bf0163..690882b 100644 --- a/dda.c +++ b/dda.c @@ -115,16 +115,11 @@ void dda_create(DDA *dda, TARGET *target) { if (dda->waitfor_temp) return; - // Initialise DDA to a known state. This also clears flags like - // dda->live, dda->done and dda->wait_for_temp. - dda->allflags = 0; - if (DEBUG_DDA && (debug_flags & DEBUG_DDA)) sersendf_P(PSTR("\nCreate: X %lq Y %lq Z %lq F %lu\n"), dda->endpoint.X, dda->endpoint.Y, dda->endpoint.Z, dda->endpoint.F); - // we end at the passed target memcpy(&(dda->endpoint), target, sizeof(TARGET)); diff --git a/dda_queue.c b/dda_queue.c index 43d64d4..6a4ce2c 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -113,6 +113,10 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) { DDA* new_movebuffer = &(movebuffer[h]); + // Initialise queue entry to a known state. This also clears flags like + // dda->live, dda->done and dda->wait_for_temp. + new_movebuffer->allflags = 0; + if (t != NULL) { new_movebuffer->endstop_check = endstop_check; new_movebuffer->endstop_stop_cond = endstop_stop_cond;