fix extui timers

This commit is contained in:
InsanityAutomation
2019-09-07 10:31:33 -04:00
parent 0e04d7b43d
commit ea34fa2616
4 changed files with 20 additions and 13 deletions
+2 -2
View File
@@ -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
/*
-10
View File
@@ -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)
+15 -1
View File
@@ -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();
+3
View File
@@ -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++;