fix extui timers
This commit is contained in:
@@ -113,8 +113,8 @@
|
||||
Requires a sensor from above
|
||||
Melzi board users may only select ABL_BI for bilinear leveling
|
||||
*/
|
||||
//#define ABL_BI
|
||||
#define ABL_UBL
|
||||
#define ABL_BI
|
||||
//#define ABL_UBL
|
||||
|
||||
//#define POWER_LOSS_RECOVERY //Large and does not fit with any other features on Melzi, or UBL on Atmega
|
||||
/*
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
#include "../../module/printcounter.h"
|
||||
#include "../../lcd/ultralcd.h"
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extensible_ui/ui_api.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M75: Start print timer
|
||||
*/
|
||||
@@ -40,9 +36,6 @@ void GcodeSuite::M75() {
|
||||
*/
|
||||
void GcodeSuite::M76() {
|
||||
print_job_timer.pause();
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerPaused();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,9 +43,6 @@ void GcodeSuite::M76() {
|
||||
*/
|
||||
void GcodeSuite::M77() {
|
||||
print_job_timer.stop();
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerStopped();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(PRINTCOUNTER)
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../lcd/extensible_ui/ui_api.h"
|
||||
#endif
|
||||
|
||||
Stopwatch::State Stopwatch::state;
|
||||
millis_t Stopwatch::accumulator;
|
||||
millis_t Stopwatch::startTimestamp;
|
||||
@@ -34,6 +38,10 @@ bool Stopwatch::stop() {
|
||||
Stopwatch::debug(PSTR("stop"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerStopped();
|
||||
#endif
|
||||
|
||||
if (isRunning() || isPaused()) {
|
||||
state = STOPPED;
|
||||
stopTimestamp = millis();
|
||||
@@ -46,7 +54,9 @@ bool Stopwatch::pause() {
|
||||
#if ENABLED(DEBUG_STOPWATCH)
|
||||
Stopwatch::debug(PSTR("pause"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerPaused();
|
||||
#endif
|
||||
if (isRunning()) {
|
||||
state = PAUSED;
|
||||
stopTimestamp = millis();
|
||||
@@ -60,6 +70,10 @@ bool Stopwatch::start() {
|
||||
Stopwatch::debug(PSTR("start"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerStarted();
|
||||
#endif
|
||||
|
||||
if (!isRunning()) {
|
||||
if (isPaused()) accumulator = duration();
|
||||
else reset();
|
||||
|
||||
@@ -294,6 +294,9 @@ bool PrintCounter::stop() {
|
||||
#if ENABLED(DEBUG_PRINTCOUNTER)
|
||||
debug(PSTR("stop"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onPrintTimerStopped();
|
||||
#endif
|
||||
|
||||
if (super::stop()) {
|
||||
data.finishedPrints++;
|
||||
|
||||
Reference in New Issue
Block a user