`starttime` is only set for SD prints via gcode `M24 and M32`
This commit is contained in:
3d-gussner 2021-02-20 13:18:53 +01:00
parent c95a8e13d7
commit cbe207eb59
1 changed files with 10 additions and 30 deletions

View File

@ -673,8 +673,7 @@ void lcdui_print_time(void)
{ {
//if remaining print time estimation is available print it else print elapsed time //if remaining print time estimation is available print it else print elapsed time
int chars = 0; int chars = 0;
if ((PRINTER_ACTIVE) && (starttime != 0)) if (PRINTER_ACTIVE) {
{
uint16_t print_t = 0; uint16_t print_t = 0;
uint16_t print_tr = 0; uint16_t print_tr = 0;
uint16_t print_tc = 0; uint16_t print_tc = 0;
@ -682,31 +681,20 @@ void lcdui_print_time(void)
char suff_doubt = ' '; char suff_doubt = ' ';
#ifdef TMC2130 #ifdef TMC2130
if (SilentModeMenu != SILENT_MODE_OFF) if (SilentModeMenu != SILENT_MODE_OFF) {
{
if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT)
{
print_tr = print_time_remaining_silent; print_tr = print_time_remaining_silent;
}
//#ifdef CLOCK_INTERVAL_TIME //#ifdef CLOCK_INTERVAL_TIME
if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT)
{
print_tc = print_time_to_change_silent; print_tc = print_time_to_change_silent;
}
//#endif //CLOCK_INTERVAL_TIME //#endif //CLOCK_INTERVAL_TIME
} } else {
else
{
#endif //TMC2130 #endif //TMC2130
if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)
{
print_tr = print_time_remaining_normal; print_tr = print_time_remaining_normal;
}
//#ifdef CLOCK_INTERVAL_TIME //#ifdef CLOCK_INTERVAL_TIME
if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT)
{
print_tc = print_time_to_change_normal; print_tc = print_time_to_change_normal;
}
//#endif //CLOCK_INTERVAL_TIME //#endif //CLOCK_INTERVAL_TIME
#ifdef TMC2130 #ifdef TMC2130
} }
@ -714,30 +702,22 @@ void lcdui_print_time(void)
//#ifdef CLOCK_INTERVAL_TIME //#ifdef CLOCK_INTERVAL_TIME
if (clock_interval == CLOCK_INTERVAL_TIME*2) if (clock_interval == CLOCK_INTERVAL_TIME*2)
{
clock_interval = 0; clock_interval = 0;
}
clock_interval++; clock_interval++;
if (print_tc != 0 && clock_interval > CLOCK_INTERVAL_TIME) if (print_tc != 0 && clock_interval > CLOCK_INTERVAL_TIME) {
{
print_t = print_tc; print_t = print_tc;
suff = 'C'; suff = 'C';
} } else
else
//#endif //CLOCK_INTERVAL_TIME //#endif //CLOCK_INTERVAL_TIME
if (print_tr != 0) if (print_tr != 0) {
{
print_t = print_tr; print_t = print_tr;
suff = 'R'; suff = 'R';
} } else
else print_t = _millis() / 60000 - starttime / 60000;
{
print_t = _millis() / 60000 - starttime / 60000;
}
if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) {
{
suff_doubt = '?'; suff_doubt = '?';
print_t = 100ul * print_t / feedmultiply; print_t = 100ul * print_t / feedmultiply;
} }