Service interval watchdog (#13105)

This commit is contained in:
revilor
2019-02-12 22:58:56 +01:00
committed by Scott Lahteine
parent 7f1b69b0c8
commit e56c13670d
81 changed files with 1321 additions and 16 deletions

View File

@@ -42,6 +42,15 @@ struct printStatistics { // 16 bytes
uint32_t printTime; // Accumulated printing time
uint32_t longestPrint; // Longest successful print job
float filamentUsed; // Accumulated filament consumed in mm
#if SERVICE_INTERVAL_1 > 0
uint32_t nextService1; // Service intervals (or placeholders)
#endif
#if SERVICE_INTERVAL_2 > 0
uint32_t nextService2;
#endif
#if SERVICE_INTERVAL_3 > 0
uint32_t nextService3;
#endif
};
class PrintCounter: public Stopwatch {
@@ -49,9 +58,9 @@ class PrintCounter: public Stopwatch {
typedef Stopwatch super;
#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) || defined(CPU_32_BIT)
typedef uint32_t promdress;
typedef uint32_t eeprom_address_t;
#else
typedef uint16_t promdress;
typedef uint16_t eeprom_address_t;
#endif
static printStatistics data;
@@ -60,7 +69,7 @@ class PrintCounter: public Stopwatch {
* @brief EEPROM address
* @details Defines the start offset address where the data is stored.
*/
static const promdress address;
static const eeprom_address_t address;
/**
* @brief Interval in seconds between counter updates
@@ -174,6 +183,11 @@ class PrintCounter: public Stopwatch {
static bool stop();
static void reset();
#if HAS_SERVICE_INTERVALS
static void resetServiceInterval(const int index);
static bool needsService(const int index);
#endif
#if ENABLED(DEBUG_PRINTCOUNTER)
/**