mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
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.
This commit is contained in:
committed by
Ben V. Brown
parent
2494522e85
commit
9127802acc
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user