Prusa-firmware: When printing from SD, for more that 6 hours, the print statistic screen shows negative time

Created on 14 Sep 2018  路  1Comment  路  Source: prusa3d/Prusa-Firmware

I never looked there before, but now that main status screen shows the remaining time instead of how much time the print was running, I started to take a look at that status screen and noticed this.

The fix is probably this
(Next time I'll send a pull request, need to learn how to do this and I am very short on time recently)

diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp
index b78b4c9..c5920e6 100644
--- a/Firmware/ultralcd.cpp
+++ b/Firmware/ultralcd.cpp
@@ -2468,7 +2468,7 @@ void lcd_menu_statistics()
        {
                float _met = ((float)total_filament_used) / (100000.f);
                int _cm = (total_filament_used - (_met * 100000)) / 10;
-               int _t = (millis() - starttime) / 1000;
+               unsigned long _t = (millis() - starttime) / 1000;
                int _h = _t / 3600;
                int _m = (_t - (_h * 3600)) / 60;
                int _s = _t - ((_h * 3600) + (_m * 60));
bug

Most helpful comment

Thank you for reporting and pointing to problematic code.
Fixed in https://github.com/prusa3d/Prusa-Firmware/pull/1176

>All comments

Thank you for reporting and pointing to problematic code.
Fixed in https://github.com/prusa3d/Prusa-Firmware/pull/1176

Was this page helpful?
0 / 5 - 0 ratings