update code base to Marlin 2.0.9.2

This commit is contained in:
Stefan Kalscheuer
2021-10-03 18:57:12 +02:00
parent b9d7ba838e
commit 7077da3591
2617 changed files with 332093 additions and 103438 deletions

38
Marlin/src/module/printcounter.h Executable file → Normal file
View File

@@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
@@ -28,12 +28,8 @@
// Print debug messages with M111 S2
//#define DEBUG_PRINTCOUNTER
#if USE_WIRED_EEPROM
// round up address to next page boundary (assuming 32 byte pages)
#define STATS_EEPROM_ADDRESS 0x40
#else
#define STATS_EEPROM_ADDRESS 0x32
#endif
// Round up I2C / SPI address to next page boundary (assuming 32 byte pages)
#define STATS_EEPROM_ADDRESS TERN(USE_WIRED_EEPROM, 0x40, 0x32)
struct printStatistics { // 16 bytes
//const uint8_t magic; // Magic header, it will always be 0x16
@@ -57,7 +53,7 @@ class PrintCounter: public Stopwatch {
private:
typedef Stopwatch super;
#if USE_WIRED_EEPROM || defined(CPU_32_BIT)
#if EITHER(USE_WIRED_EEPROM, CPU_32_BIT)
typedef uint32_t eeprom_address_t;
#else
typedef uint16_t eeprom_address_t;
@@ -75,19 +71,18 @@ class PrintCounter: public Stopwatch {
* @brief Interval in seconds between counter updates
* @details This const value defines what will be the time between each
* 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.
*/
static constexpr uint16_t updateInterval = 10;
static constexpr millis_t updateInterval = SEC_TO_MS(10);
/**
* @brief Interval in seconds between EEPROM saves
* @details This const value defines what will be the time between each
* EEPROM save cycle, the development team recommends to set this value
* no lower than 3600 secs (1 hour).
*/
static constexpr uint16_t saveInterval = 3600;
#if PRINTCOUNTER_SAVE_INTERVAL > 0
/**
* @brief Interval in seconds between EEPROM saves
* @details This const value defines what will be the time between each
* EEPROM save cycle, the development team recommends to set this value
* no lower than 3600 secs (1 hour).
*/
static constexpr millis_t saveInterval = MIN_TO_MS(PRINTCOUNTER_SAVE_INTERVAL);
#endif
/**
* @brief Timestamp of the last call to deltaDuration()
@@ -180,7 +175,10 @@ class PrintCounter: public Stopwatch {
* The following functions are being overridden
*/
static bool start();
static bool stop();
static bool _stop(const bool completed);
static inline bool stop() { return _stop(true); }
static inline bool abort() { return _stop(false); }
static void reset();
#if HAS_SERVICE_INTERVALS