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

Followup for #3813
This commit is contained in:
Scott Lahteine 2016-05-23 13:56:11 -07:00
commit 678cbad76a
2 changed files with 5 additions and 1 deletions

View File

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

View File

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