try to deal with consecutive null moves

This commit is contained in:
Michael Moon 2011-03-05 15:55:55 +11:00
parent c177756913
commit 16944d4394
1 changed files with 16 additions and 14 deletions

View File

@ -88,20 +88,22 @@ void enqueue(TARGET *t) {
// sometimes called from normal program execution, sometimes from interrupt context // sometimes called from normal program execution, sometimes from interrupt context
void next_move() { void next_move() {
if (queue_empty() == 0) { if (queue_empty() == 0) {
// next item do {
uint8_t t = mb_tail + 1; // next item
t &= (MOVEBUFFER_SIZE - 1); uint8_t t = mb_tail + 1;
if (movebuffer[t].waitfor_temp) { t &= (MOVEBUFFER_SIZE - 1);
#ifndef REPRAP_HOST_COMPATIBILITY if (movebuffer[t].waitfor_temp) {
serial_writestr_P(PSTR("Waiting for target temp\n")); #ifndef REPRAP_HOST_COMPATIBILITY
#endif serial_writestr_P(PSTR("Waiting for target temp\n"));
movebuffer[t].live = 1; #endif
setTimer(movebuffer[t].c >> 8); movebuffer[t].live = 1;
} setTimer(movebuffer[t].c >> 8);
else { }
dda_start(&movebuffer[t]); else {
} dda_start(&movebuffer[t]);
mb_tail = t; }
mb_tail = t;
} while ((queue_empty() == 0) && (movebuffer[mb_tail].live == 0));
} }
else else
setTimer(0); setTimer(0);