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

View File

@ -32,6 +32,7 @@ void queue_step() {
// do our next step
if (movebuffer[mb_tail].live) {
if (movebuffer[mb_tail].waitfor_temp) {
setTimer(movebuffer[mb_tail].c >> 8);
if (temp_achieved()) {
movebuffer[mb_tail].live = movebuffer[mb_tail].waitfor_temp = 0;
serial_writestr_P(PSTR("Temp achieved\n"));
@ -90,7 +91,16 @@ void next_move() {
// next item
uint8_t t = mb_tail + 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;
}
else