Use static classes for job timers (#9940)

This commit is contained in:
Scott Lahteine 2018-03-04 22:52:25 -06:00 committed by GitHub
parent bc08ce86be
commit f0d8d76f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 193 additions and 173 deletions

View file

@ -260,6 +260,7 @@
#include "pins_arduino.h"
#include "math.h"
#include "nozzle.h"
#include "printcounter.h"
#include "duration_t.h"
#include "types.h"
#include "gcode.h"
@ -515,13 +516,6 @@ millis_t previous_cmd_ms = 0;
static millis_t max_inactive_time = 0;
static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
// Print Job Timer
#if ENABLED(PRINTCOUNTER)
PrintCounter print_job_timer = PrintCounter();
#else
Stopwatch print_job_timer = Stopwatch();
#endif
// Auto Power Control
#if ENABLED(AUTO_POWER_CONTROL)
#define PSU_ON() powerManager.power_on()
@ -13703,6 +13697,8 @@ void setup() {
thermalManager.init(); // Initialize temperature loop
print_job_timer.init(); // Initial setup of print job timer
#if ENABLED(USE_WATCHDOG)
watchdog_init();
#endif