Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../libs/stopwatch.h"
25 #include "../libs/duration_t.h"
26 #include "../inc/MarlinConfig.h"
31 #if EITHER(I2C_EEPROM, SPI_EEPROM)
33 #define STATS_EEPROM_ADDRESS 0x40
35 #define STATS_EEPROM_ADDRESS 0x32
45 #if SERVICE_INTERVAL_1 > 0
46 uint32_t nextService1;
48 #if SERVICE_INTERVAL_2 > 0
49 uint32_t nextService2;
51 #if SERVICE_INTERVAL_3 > 0
52 uint32_t nextService3;
60 #if EITHER(I2C_EEPROM, SPI_EEPROM) || defined(CPU_32_BIT)
61 typedef uint32_t eeprom_address_t;
63 typedef uint16_t eeprom_address_t;
72 static const eeprom_address_t address;
82 static constexpr uint16_t updateInterval = 10;
90 static constexpr uint16_t saveInterval = 3600;
186 #if HAS_SERVICE_INTERVALS
187 static void resetServiceInterval(
const int index);
188 static bool needsService(
const int index);
191 #if ENABLED(DEBUG_PRINTCOUNTER)
197 static void debug(
const char func[]);
203 #if ENABLED(PRINTCOUNTER)
char * toString(char *const buffer) const
Formats the duration as a string.
Definition: duration_t.h:123
#define SERIAL_CHAR(x)
Definition: serial.h:69
static bool start()
Definition: printcounter.cpp:269
static FORCE_INLINE bool isRunning()
Check if the timer is running.
Definition: stopwatch.h:93
float filamentUsed
Definition: printcounter.h:44
static void init()
Initialize the print counter.
Definition: printcounter.h:120
static void saveStats()
Save the Print Statistics.
Definition: printcounter.cpp:166
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc)
#define MSG_STATS
Definition: language.h:159
static bool stop()
Definition: printcounter.cpp:288
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
static bool access_finish()
uint8_t data[8]
Definition: masstorage.h:49
Definition: printcounter.h:56
static bool access_start()
static void incFilamentUsed(float const &amount)
Increment the total filament used.
Definition: printcounter.cpp:82
uint8_t i
Definition: screen_test_graph.c:72
#define _MIN(V...)
Definition: macros.h:333
uint32_t millis(void)
Definition: wiring_time.c:29
#define SERIAL_ECHO_START()
Definition: serial.h:179
static bool stop()
Stop the stopwatch.
Definition: stopwatch.cpp:36
static FORCE_INLINE bool isLoaded()
Check if Print Statistics has been loaded.
Definition: printcounter.h:130
static void tick()
Loop function.
Definition: printcounter.cpp:235
uint32_t longestPrint
Definition: printcounter.h:43
uint16_t finishedPrints
Definition: printcounter.h:41
PrintCounter print_job_timer
Definition: printcounter.cpp:63
static millis_t deltaDuration()
dT since the last call
Definition: printcounter.cpp:72
#define FORCE_INLINE
Definition: macros.h:40
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
#define PSTR(str)
Definition: pgmspace.h:31
uint32_t printTime
Definition: printcounter.h:42
void onConfigurationStoreWritten(bool success)
Definition: marlin_server.cpp:937
static millis_t duration()
Get the running time.
Definition: stopwatch.cpp:108
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
Definition: printcounter.h:38
static bool start()
Start the stopwatch.
Definition: stopwatch.cpp:68
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
static void reset()
Reset the stopwatch.
Definition: stopwatch.cpp:97
static void reset()
Definition: printcounter.cpp:307
static void loadStats()
Load the Print Statistics.
Definition: printcounter.cpp:131
#define ELAPSED(NOW, SOON)
Definition: millis_t.h:29
const uint8_t[]
Definition: 404_html.c:3
static FORCE_INLINE bool isPaused()
Check if the timer is paused.
Definition: stopwatch.h:100
Stopwatch print_job_timer
Definition: printcounter.cpp:63
static bool read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing=true)
uint16_t totalPrints
Definition: printcounter.h:40
#define DEBUGGING(F)
Definition: serial.h:47
#define SERIAL_EOL()
Definition: serial.h:181
#define HAS_SERVICE_INTERVALS
Definition: Conditionals_LCD.h:534
static FORCE_INLINE void init()
Initialize the stopwatch.
Definition: stopwatch.h:50
PersistentStore persistentStore
Definition: persistent_store_api.cpp:28
Definition: duration_t.h:26
static void showStats()
Serial output the Print Statistics.
Definition: printcounter.cpp:192
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
static void initStats()
Reset the Print Statistics.
Definition: printcounter.cpp:93
#define UNUSED(X)
Definition: stm32f4xx_hal_def.h:74
static printStatistics getStats()
Return the currently loaded statistics.
Definition: printcounter.h:170
#define STATS_EEPROM_ADDRESS
Definition: printcounter.h:33
uint32_t millis_t
Definition: millis_t.h:26
#define BUZZ(d, f)
Definition: buzzer.h:126
Stopwatch class.
Definition: stopwatch.h:37