Init print_job_timer in setup() instead of "early" (#9937)
This commit is contained in:
parent
beeed580b8
commit
025118da3e
|
@ -730,7 +730,11 @@ void setup() {
|
||||||
// Load data from EEPROM if available (or use defaults)
|
// Load data from EEPROM if available (or use defaults)
|
||||||
// This also updates variables in the planner, elsewhere
|
// This also updates variables in the planner, elsewhere
|
||||||
(void)settings.load();
|
(void)settings.load();
|
||||||
|
|
||||||
|
#if ENABLED(PRINTCOUNTER)
|
||||||
|
print_job_timer.init();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_M206_COMMAND
|
#if HAS_M206_COMMAND
|
||||||
// Initialize current position based on home_offset
|
// Initialize current position based on home_offset
|
||||||
COPY(current_position, home_offset);
|
COPY(current_position, home_offset);
|
||||||
|
|
|
@ -52,6 +52,11 @@ class Stopwatch {
|
||||||
*/
|
*/
|
||||||
Stopwatch();
|
Stopwatch();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the stopwatch
|
||||||
|
*/
|
||||||
|
inline void init() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Stops the stopwatch
|
* @brief Stops the stopwatch
|
||||||
* @details Stops the running timer, it will silently ignore the request if
|
* @details Stops the running timer, it will silently ignore the request if
|
||||||
|
|
|
@ -28,10 +28,6 @@
|
||||||
|
|
||||||
#include "../Marlin.h"
|
#include "../Marlin.h"
|
||||||
|
|
||||||
PrintCounter::PrintCounter(): super() {
|
|
||||||
this->loadStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
millis_t PrintCounter::deltaDuration() {
|
millis_t PrintCounter::deltaDuration() {
|
||||||
#if ENABLED(DEBUG_PRINTCOUNTER)
|
#if ENABLED(DEBUG_PRINTCOUNTER)
|
||||||
PrintCounter::debug(PSTR("deltaDuration"));
|
PrintCounter::debug(PSTR("deltaDuration"));
|
||||||
|
|
|
@ -99,10 +99,14 @@ class PrintCounter: public Stopwatch {
|
||||||
millis_t deltaDuration();
|
millis_t deltaDuration();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Class constructor
|
* @brief Initialize the print counter
|
||||||
*/
|
*/
|
||||||
PrintCounter();
|
inline void init() {
|
||||||
|
super::init();
|
||||||
|
this->loadStats();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if Print Statistics has been loaded
|
* @brief Checks if Print Statistics has been loaded
|
||||||
|
|
Loading…
Reference in a new issue