1
0
forked from me/IronOS

profile mode is optional

This commit is contained in:
Laura Klünder
2023-04-23 18:36:07 +02:00
parent 5c69458f1a
commit 448e5c8ad1
4 changed files with 27 additions and 1 deletions

View File

@@ -55,8 +55,12 @@ void drawHomeScreen(bool buttonLockout) {
showDebugMenu();
break;
case BUTTON_F_LONG:
#ifdef PROFILE_MODE
// todo: add profile mode
#else
gui_solderingTempAdjust();
saveSettings();
#endif
break;
case BUTTON_F_SHORT:
if (!isTipDisconnected()) {

View File

@@ -4,23 +4,31 @@ void gui_solderingTempAdjust(void) {
currentTempTargetDegC = 0; // Turn off heater while adjusting temp
TickType_t autoRepeatTimer = 0;
uint8_t autoRepeatAcceleration = 0;
#ifndef PROFILE_MODE
bool waitForRelease = false;
ButtonState buttons = getButtonState();
if (buttons != BUTTON_NONE) {
// Temp adjust entered by long-pressing F button.
waitForRelease = true;
}
#else
ButtonState buttons;
#endif
for (;;) {
OLED::setCursor(0, 0);
OLED::clearScreen();
buttons = getButtonState();
if (buttons) {
lastChange = xTaskGetTickCount();
#ifndef PROFILE_MODE
if (waitForRelease) {
buttons = BUTTON_NONE;
}
lastChange = xTaskGetTickCount();
} else {
waitForRelease = false;
#endif
}
int16_t delta = 0;
switch (buttons) {