fix waitfor temperature, for M109 and friends

This commit is contained in:
Michael Moon 2010-12-19 07:09:19 +11:00
parent a8819fbb1b
commit ecc0d6e3ef
2 changed files with 32 additions and 22 deletions

42
dda.c
View File

@ -330,32 +330,32 @@ void dda_start(DDA *dda) {
// keep dda->live = 0 // keep dda->live = 0
} }
else { else {
if (dda->waitfor_temp) { /* if (dda->waitfor_temp) {
#ifndef REPRAP_HOST_COMPATIBILITY #ifndef REPRAP_HOST_COMPATIBILITY
serial_writestr_P(PSTR("Waiting for target temp\n")); serial_writestr_P(PSTR("Waiting for target temp\n"));
#endif #endif
} }
else { else {*/
// ensure steppers are ready to go // ensure steppers are ready to go
steptimeout = 0; steptimeout = 0;
power_on(); power_on();
x_enable(); x_enable();
y_enable(); y_enable();
if (dda->z_delta) if (dda->z_delta)
z_enable(); z_enable();
// set direction outputs // set direction outputs
x_direction(dda->x_direction); x_direction(dda->x_direction);
y_direction(dda->y_direction); y_direction(dda->y_direction);
z_direction(dda->z_direction); z_direction(dda->z_direction);
e_direction(dda->e_direction); e_direction(dda->e_direction);
#ifdef DC_EXTRUDER #ifdef DC_EXTRUDER
if (dda->e_delta) if (dda->e_delta)
heater_set(DC_EXTRUDER, DC_EXTRUDER_PWM); heater_set(DC_EXTRUDER, DC_EXTRUDER_PWM);
#endif #endif
} // }
// ensure this dda starts // ensure this dda starts
dda->live = 1; dda->live = 1;

View File

@ -32,6 +32,7 @@ void queue_step() {
// do our next step // do our next step
if (movebuffer[mb_tail].live) { if (movebuffer[mb_tail].live) {
if (movebuffer[mb_tail].waitfor_temp) { if (movebuffer[mb_tail].waitfor_temp) {
setTimer(movebuffer[mb_tail].c >> 8);
if (temp_achieved()) { if (temp_achieved()) {
movebuffer[mb_tail].live = movebuffer[mb_tail].waitfor_temp = 0; movebuffer[mb_tail].live = movebuffer[mb_tail].waitfor_temp = 0;
serial_writestr_P(PSTR("Temp achieved\n")); serial_writestr_P(PSTR("Temp achieved\n"));
@ -90,7 +91,16 @@ void next_move() {
// next item // next item
uint8_t t = mb_tail + 1; uint8_t t = mb_tail + 1;
t &= (MOVEBUFFER_SIZE - 1); t &= (MOVEBUFFER_SIZE - 1);
dda_start(&movebuffer[t]); if (movebuffer[t].waitfor_temp) {
#ifndef REPRAP_HOST_COMPATIBILITY
serial_writestr_P(PSTR("Waiting for target temp\n"));
#endif
movebuffer[t].live = 1;
setTimer(movebuffer[t].c >> 8);
}
else {
dda_start(&movebuffer[t]);
}
mb_tail = t; mb_tail = t;
} }
else else