|
@@ -3948,12 +3948,22 @@ inline void gcode_M17() {
|
3948
|
3948
|
*/
|
3949
|
3949
|
inline void gcode_M31() {
|
3950
|
3950
|
millis_t t = print_job_timer.duration();
|
3951
|
|
- int min = t / 60, sec = t % 60;
|
3952
|
|
- char time[30];
|
3953
|
|
- sprintf_P(time, PSTR("%i min, %i sec"), min, sec);
|
|
3951
|
+ int d = int(t / 60 / 60 / 24),
|
|
3952
|
+ h = int(t / 60 / 60) % 60,
|
|
3953
|
+ m = int(t / 60) % 60,
|
|
3954
|
+ s = int(t % 60);
|
|
3955
|
+ char time[18]; // 123456789012345678
|
|
3956
|
+ if (d)
|
|
3957
|
+ sprintf_P(time, PSTR("%id %ih %im %is"), d, h, m, s); // 99d 23h 59m 59s
|
|
3958
|
+ else
|
|
3959
|
+ sprintf_P(time, PSTR("%ih %im %is"), h, m, s); // 23h 59m 59s
|
|
3960
|
+
|
|
3961
|
+ lcd_setstatus(time);
|
|
3962
|
+
|
3954
|
3963
|
SERIAL_ECHO_START;
|
|
3964
|
+ SERIAL_ECHOPGM(MSG_PRINT_TIME " ");
|
3955
|
3965
|
SERIAL_ECHOLN(time);
|
3956
|
|
- lcd_setstatus(time);
|
|
3966
|
+
|
3957
|
3967
|
thermalManager.autotempShutdown();
|
3958
|
3968
|
}
|
3959
|
3969
|
|