Browse Source

Switch between Remaing and Change time every few seconds
- If `M73` `R,S,C,D` values set the LCD Info screen clock switchs between Remaining and Change time
- If Remaining time is 0 while Change time is >0 the clock switchs between Change time and actual printing time
- If Change is 0 while Remaining time is >0 the clock shows the Remaining time
- If both are 0 the clock shows the actual printing time
- `M73 C` values are shown in "Normal" mode
- `M73 D` values are shown in "Stealth" mode
- Changing the speed will try to calculate the espected times and show `?` behind `R` or `C`

3d-gussner 3 years ago
parent
commit
f810047a5c
2 changed files with 25 additions and 21 deletions
  1. 1 2
      Firmware/Configuration_adv.h
  2. 24 19
      Firmware/ultralcd.cpp

+ 1 - 2
Firmware/Configuration_adv.h

@@ -339,10 +339,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
 //#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
+#define CLOCK_INTERVAL_TIME 5
 
 //===========================================================================
 //=============================Buffers           ============================

+ 24 - 19
Firmware/ultralcd.cpp

@@ -57,7 +57,7 @@
 
 int scrollstuff = 0;
 char longFilenameOLD[LONG_FILENAME_LENGTH];
-
+int clock_interval = 0;
 
 static void lcd_sd_updir();
 static void lcd_mesh_bed_leveling_settings();
@@ -680,53 +680,58 @@ void lcdui_print_time(void)
         uint16_t print_tc = 0;
         char suff = ' ';
         char suff_doubt = ' ';
-        static ShortTimer IntervalTimer;
-
 
-        #ifdef TMC2130
+#ifdef TMC2130
         if (SilentModeMenu != SILENT_MODE_OFF)
         {
             if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT)
             {
                 print_tr = print_time_remaining_silent;
             }
+//#ifdef CLOCK_INTERVAL_TIME
             if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT)
             {
                 print_tc = print_time_to_change_silent;
             }
+//#endif //CLOCK_INTERVAL_TIME
         }
         else
         {
-        #endif //TMC2130
+#endif //TMC2130
             if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)
             {
                 print_tr = print_time_remaining_normal;
             }
+//#ifdef CLOCK_INTERVAL_TIME
             if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT)
             {
                 print_tc = print_time_to_change_normal;
             }
-        #ifdef TMC2130
+//#endif //CLOCK_INTERVAL_TIME
+#ifdef TMC2130
         }
-        #endif //TMC2130
+#endif //TMC2130
 
-        if (print_tr != 0)
+//#ifdef CLOCK_INTERVAL_TIME
+        if (clock_interval == CLOCK_INTERVAL_TIME*2)
         {
-            print_t = print_tr;
-            suff = 'R';
+            clock_interval = 0;
         }
+        clock_interval++;
 
-        if (print_tc != 0)
+        if (print_tc != 0 && clock_interval > CLOCK_INTERVAL_TIME)
         {
-            if (IntervalTimer.expired(CLOCK_INTERVAL_TIME))
-            {
-                print_t = print_tc;
-                suff = 'C';
-                IntervalTimer.start();
-            }
+            print_t = print_tc;
+            suff = 'C';
         }
-
-        if (print_tr == 0)
+        else
+//#endif //CLOCK_INTERVAL_TIME 
+        if (print_tr != 0)
+        {
+            print_t = print_tr;
+            suff = 'R';
+        }
+        else
         {
             print_t = _millis() / 60000 - starttime / 60000; 
         }