aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuri Schaeffer <[email protected]>2018-07-29 03:35:25 +0200
committerBen V. Brown <[email protected]>2018-07-29 11:35:25 +1000
commit9127802acc6f2689a430e8fcc5ea2d5fc63e510f (patch)
tree8ea9267a6423d8a595f46268805267beef1a95e6
parent2494522e8592385f3ca360c5ae4945858b54511e (diff)
downloadIronOS-9127802acc6f2689a430e8fcc5ea2d5fc63e510f.tar.gz
IronOS-9127802acc6f2689a430e8fcc5ea2d5fc63e510f.zip
Display seconds until sleep in soldering mode. (#311)
Adds a number indicator to the detailed soldering mode that shows the pending time until the iron goes to sleep.
-rw-r--r--workspace/TS100/src/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp
index 7516d679..18cf56b5 100644
--- a/workspace/TS100/src/main.cpp
+++ b/workspace/TS100/src/main.cpp
@@ -434,6 +434,24 @@ static int gui_SolderingSleepingMode() {
}
return 0;
}
+
+static void display_countdown(int sleepThres) {
+ /*
+ * Print seconds or minutes (if > 99 seconds) until sleep
+ * mode is triggered.
+ */
+ int lastEventTime = lastButtonTime < lastMovementTime ?
+ lastMovementTime : lastButtonTime;
+ int downCount = sleepThres - xTaskGetTickCount() + lastEventTime;
+ if (downCount > 9900) {
+ lcd.printNumber(downCount/6000 + 1, 2);
+ lcd.print("M");
+ } else {
+ lcd.printNumber(downCount/100 + 1, 2);
+ lcd.print("S");
+ }
+}
+
static void gui_solderingMode() {
/*
* * Soldering (gui_solderingMode)
@@ -504,6 +522,12 @@ static void gui_solderingMode() {
lcd.printNumber(getTipPWM(), 3);
lcd.print("%");
+ if (systemSettings.sensitivity && systemSettings.SleepTime)
+ {
+ lcd.print(" ");
+ display_countdown(sleepThres);
+ }
+
lcd.setCursor(0, 8);
lcd.print(SleepingTipAdvancedString);
gui_drawTipTemp(true);