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;