Browse Source

Add CLOCK_INTERVAL_TIME and ShortTimer IntervalTimer

3d-gussner 3 years ago
parent
commit
14b4bf5fa5
2 changed files with 15 additions and 7 deletions
  1. 6 0
      Firmware/Configuration_adv.h
  2. 9 7
      Firmware/ultralcd.cpp

+ 6 - 0
Firmware/Configuration_adv.h

@@ -338,6 +338,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st
 // Control heater 0 and heater 1 in parallel.
 //#define HEATERS_PARALLEL
 
+//LCD status clock interval timer to switch between
+// print time
+// remaining print time
+// and time to change/pause/interaction
+#define CLOCK_INTERVAL_TIME 5000
+
 //===========================================================================
 //=============================Buffers           ============================
 //===========================================================================

+ 9 - 7
Firmware/ultralcd.cpp

@@ -673,6 +673,7 @@ 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;
@@ -708,17 +709,18 @@ void lcdui_print_time(void)
         }
         #endif //TMC2130
 
-        if (print_tc != 0)
-        {
-            print_t = print_tc;
-            suff = 'C';
-        }
-        else if (print_tr != 0)
+        if (print_tr != 0)
         {
             print_t = print_tr;
             suff = 'R';
         }
-        else
+        else if (print_tc != 0)
+        {
+            print_t = print_tc;
+            suff = 'C';
+        }
+
+        if (print_tr == 0)
         {
             print_t = _millis() / 60000 - starttime / 60000; 
         }