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.