Browse Source

Fix timer issue
The remaining time stays for ~5 seconds while the change time stays just for ~1 second

3d-gussner 3 years ago
parent
commit
cf982b0d4d
1 changed files with 10 additions and 4 deletions
  1. 10 4
      Firmware/ultralcd.cpp

+ 10 - 4
Firmware/ultralcd.cpp

@@ -673,7 +673,6 @@ void lcdui_print_time(void)
 {
     //if remaining print time estimation is available print it else print elapsed time
     int chars = 0;
-    ShortTimer IntervalTimer;
     if ((PRINTER_ACTIVE) && (starttime != 0))
     {
         uint16_t print_t = 0;
@@ -681,6 +680,8 @@ void lcdui_print_time(void)
         uint16_t print_tc = 0;
         char suff = ' ';
         char suff_doubt = ' ';
+        static ShortTimer IntervalTimer;
+
 
         #ifdef TMC2130
         if (SilentModeMenu != SILENT_MODE_OFF)
@@ -714,10 +715,15 @@ void lcdui_print_time(void)
             print_t = print_tr;
             suff = 'R';
         }
-        else if (print_tc != 0)
+
+        if (print_tc != 0)
         {
-            print_t = print_tc;
-            suff = 'C';
+            if (IntervalTimer.expired(5000))
+            {
+                print_t = print_tc;
+                suff = 'C';
+                IntervalTimer.start();
+            }
         }
 
         if (print_tr == 0)