Browse Source

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

Followup for #3813
Scott Lahteine 8 years ago
parent
commit
678cbad76a
2 changed files with 5 additions and 1 deletions
  1. 2
    1
      Marlin/printcounter.cpp
  2. 3
    0
      Marlin/printcounter.h

+ 2
- 1
Marlin/printcounter.cpp View File

128
   }
128
   }
129
 
129
 
130
   // Trying to get the amount of calculations down to the bare min
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
   if (now - eeprom_before >= j) {
133
   if (now - eeprom_before >= j) {
134
     eeprom_before = now;
134
     eeprom_before = now;
164
     this->data.finishedPrints++;
164
     this->data.finishedPrints++;
165
     this->data.printTime += this->deltaDuration();
165
     this->data.printTime += this->deltaDuration();
166
     this->saveStats();
166
     this->saveStats();
167
+    return true;
167
   }
168
   }
168
   else return false;
169
   else return false;
169
 }
170
 }

+ 3
- 0
Marlin/printcounter.h View File

55
      * @brief Interval in seconds between counter updates
55
      * @brief Interval in seconds between counter updates
56
      * @details This const value defines what will be the time between each
56
      * @details This const value defines what will be the time between each
57
      * accumulator update. This is different from the EEPROM save interval.
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
     const uint16_t updateInterval = 10;
62
     const uint16_t updateInterval = 10;
60
 
63
 

Loading…
Cancel
Save