|
|
@ -726,11 +726,8 @@ void loop() {
|
|
|
|
commands_in_queue--;
|
|
|
|
commands_in_queue--;
|
|
|
|
cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
|
|
|
|
cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Check heater every n milliseconds
|
|
|
|
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
checkHitEndstops();
|
|
|
|
checkHitEndstops();
|
|
|
|
lcd_update();
|
|
|
|
idle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void gcode_line_error(const char *err, bool doFlush=true) {
|
|
|
|
void gcode_line_error(const char *err, bool doFlush=true) {
|
|
|
@ -1998,11 +1995,7 @@ inline void gcode_G4() {
|
|
|
|
|
|
|
|
|
|
|
|
if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
|
|
|
|
if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
|
|
|
|
|
|
|
|
|
|
|
|
while (millis() < codenum) {
|
|
|
|
while (millis() < codenum) idle();
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef FWRETRACT
|
|
|
|
#ifdef FWRETRACT
|
|
|
@ -2682,9 +2675,7 @@ inline void gcode_G28() {
|
|
|
|
|
|
|
|
|
|
|
|
probePointCounter++;
|
|
|
|
probePointCounter++;
|
|
|
|
|
|
|
|
|
|
|
|
manage_heater();
|
|
|
|
idle();
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} //xProbe
|
|
|
|
} //xProbe
|
|
|
|
} //yProbe
|
|
|
|
} //yProbe
|
|
|
@ -2885,21 +2876,13 @@ inline void gcode_G92() {
|
|
|
|
st_synchronize();
|
|
|
|
st_synchronize();
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
if (codenum > 0) {
|
|
|
|
if (codenum > 0) {
|
|
|
|
codenum += previous_cmd_ms; // keep track of when we started waiting
|
|
|
|
codenum += previous_cmd_ms; // wait until this time for a click
|
|
|
|
while(millis() < codenum && !lcd_clicked()) {
|
|
|
|
while (millis() < codenum && !lcd_clicked()) idle();
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
lcd_ignore_click(false);
|
|
|
|
lcd_ignore_click(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (!lcd_detected()) return;
|
|
|
|
if (!lcd_detected()) return;
|
|
|
|
while (!lcd_clicked()) {
|
|
|
|
while (!lcd_clicked()) idle();
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IS_SD_PRINTING)
|
|
|
|
if (IS_SD_PRINTING)
|
|
|
|
LCD_MESSAGEPGM(MSG_RESUMING);
|
|
|
|
LCD_MESSAGEPGM(MSG_RESUMING);
|
|
|
@ -3525,9 +3508,9 @@ inline void gcode_M109() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
temp_ms = millis();
|
|
|
|
temp_ms = millis();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
idle();
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
#ifdef TEMP_RESIDENCY_TIME
|
|
|
|
// start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
|
|
|
|
// start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
|
|
|
|
// or when current temp falls outside the hysteresis after target temp was reached
|
|
|
|
// or when current temp falls outside the hysteresis after target temp was reached
|
|
|
@ -3575,9 +3558,7 @@ inline void gcode_M109() {
|
|
|
|
SERIAL_PROTOCOL_F(degBed(), 1);
|
|
|
|
SERIAL_PROTOCOL_F(degBed(), 1);
|
|
|
|
SERIAL_EOL;
|
|
|
|
SERIAL_EOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manage_heater();
|
|
|
|
idle();
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LCD_MESSAGEPGM(MSG_BED_DONE);
|
|
|
|
LCD_MESSAGEPGM(MSG_BED_DONE);
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
refresh_cmd_timeout();
|
|
|
@ -4262,11 +4243,7 @@ inline void gcode_M226() {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
while(digitalRead(pin_number) != target) {
|
|
|
|
while (digitalRead(pin_number) != target) idle();
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // pin_number > -1
|
|
|
|
} // pin_number > -1
|
|
|
|
} // pin_state -1 0 1
|
|
|
|
} // pin_state -1 0 1
|
|
|
@ -6253,6 +6230,15 @@ void disable_all_steppers() {
|
|
|
|
disable_e3();
|
|
|
|
disable_e3();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Standard idle routine keeps the machine alive
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void idle() {
|
|
|
|
|
|
|
|
manage_heater();
|
|
|
|
|
|
|
|
manage_inactivity();
|
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Manage several activities:
|
|
|
|
* Manage several activities:
|
|
|
|
* - Check for Filament Runout
|
|
|
|
* - Check for Filament Runout
|
|
|
|