Bläddra i källkod

Merge pull request #3819 from jbrazio/bugfix/followup-3813

Followup for #3813
Scott Lahteine 8 år sedan
förälder
incheckning
678cbad76a
2 ändrade filer med 5 tillägg och 1 borttagningar
  1. 2
    1
      Marlin/printcounter.cpp
  2. 3
    0
      Marlin/printcounter.h

+ 2
- 1
Marlin/printcounter.cpp Visa fil

@@ -128,7 +128,7 @@ void PrintCounter::tick() {
128 128
   }
129 129
 
130 130
   // Trying to get the amount of calculations down to the bare min
131
-  const static uint16_t j = this->saveInterval * 1000;
131
+  const static uint32_t j = this->saveInterval * 1000;
132 132
 
133 133
   if (now - eeprom_before >= j) {
134 134
     eeprom_before = now;
@@ -164,6 +164,7 @@ bool PrintCounter::stop() {
164 164
     this->data.finishedPrints++;
165 165
     this->data.printTime += this->deltaDuration();
166 166
     this->saveStats();
167
+    return true;
167 168
   }
168 169
   else return false;
169 170
 }

+ 3
- 0
Marlin/printcounter.h Visa fil

@@ -55,6 +55,9 @@ class PrintCounter: public Stopwatch {
55 55
      * @brief Interval in seconds between counter updates
56 56
      * @details This const value defines what will be the time between each
57 57
      * accumulator update. This is different from the EEPROM save interval.
58
+     *
59
+     * @note The max value for this option is 60(s), otherwise integer
60
+     * overflow will happen.
58 61
      */
59 62
     const uint16_t updateInterval = 10;
60 63
 

Laddar…
Avbryt
Spara