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.
This commit is contained in:
Markus Hitter 2013-11-27 20:01:32 +01:00
parent ddd8988727
commit f37a65ca36
2 changed files with 5 additions and 3 deletions

5
dda.c
View File

@ -91,10 +91,13 @@ void dda_create(DDA *dda, TARGET *target) {
static uint8_t idcnt = 0; static uint8_t idcnt = 0;
static DDA* prev_dda = NULL; static DDA* prev_dda = NULL;
if (prev_dda && prev_dda->done) if ((prev_dda && prev_dda->done) || dda->waitfor_temp)
prev_dda = NULL; prev_dda = NULL;
#endif #endif
if (dda->waitfor_temp)
return;
// initialise DDA to a known state // initialise DDA to a known state
dda->allflags = 0; dda->allflags = 0;

View File

@ -114,15 +114,14 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
DDA* new_movebuffer = &(movebuffer[h]); DDA* new_movebuffer = &(movebuffer[h]);
if (t != NULL) { if (t != NULL) {
dda_create(new_movebuffer, t);
new_movebuffer->endstop_check = endstop_check; new_movebuffer->endstop_check = endstop_check;
new_movebuffer->endstop_stop_cond = endstop_stop_cond; new_movebuffer->endstop_stop_cond = endstop_stop_cond;
} }
else { else {
// it's a wait for temp // it's a wait for temp
new_movebuffer->waitfor_temp = 1; new_movebuffer->waitfor_temp = 1;
new_movebuffer->nullmove = 0;
} }
dda_create(new_movebuffer, t);
// make certain all writes to global memory // make certain all writes to global memory
// are flushed before modifying mb_head. // are flushed before modifying mb_head.