Merge pull request #1721 from PavelSindler/time_remaining_range_MK2

Show correctly time remaining for t > 99hours (mk2)
This commit is contained in:
MRprusa3d 2019-04-12 22:16:18 +02:00 committed by GitHub
commit 491e67cbb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -715,16 +715,25 @@ static inline void lcd_print_time() {
else if(starttime != 0){
print_t = millis() / 60000 - starttime / 60000;
}
lcd.print(LCD_STR_CLOCK[0]);
uint16_t print_hours = print_t / 60;
uint8_t print_minutes = print_t % 60;
if((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)||(starttime != 0)))
{
lcd.print(itostr2(print_t/60));
if (print_hours > 99) {
if (print_hours > 999) print_hours = 999;
lcd.print(itostr3(print_hours));
}
else {
lcd.print(LCD_STR_CLOCK[0]);
lcd.print(itostr2(print_hours));
}
lcd.print(':');
lcd.print(itostr2(print_t%60));
lcd.print(itostr2(print_minutes));
(print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) ? lcd.print('R') : lcd.print(' ');
(feedmultiply == 100) ? lcd.print(' ') : lcd.print('?');
}else{
lcd_printPGM(PSTR("--:-- "));
lcd.print(LCD_STR_CLOCK[0]);
lcd_printPGM(PSTR("--:-- "));
}
}