Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoStartMode refactoring #1712

Merged
merged 4 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/Core/Inc/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ typedef enum {
FAST = 3, //
MAX_VALUE = 4 //
} settingOffSpeed_t;

typedef enum {
NO = 0, // Disabled
SOLDER = 1, // Gain default soldering temp (Soldering Mode)
SLEEP = 2, // Gain default sleeping temp (Idle/Standby Mode)
ZERO = 3, // Power on only (No heat Mode)
} autoStartMode_t;

// Settings wide operations
void saveSettings();
bool loadSettings();
Expand Down
8 changes: 4 additions & 4 deletions source/Core/Src/settingsGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,16 @@ static void displayBoostTemp(void) {
static void displayAutomaticStartMode(void) {

switch (getSettingValue(SettingsOptions::AutoStartMode)) {
case 0:
case autoStartMode_t::NO:
OLED::print(translatedString(Tr->SettingStartNoneChar), FontStyle::LARGE);
break;
case 1:
case autoStartMode_t::SOLDER:
OLED::print(translatedString(Tr->SettingStartSolderingChar), FontStyle::LARGE);
break;
case 2:
case autoStartMode_t::SLEEP:
OLED::print(translatedString(Tr->SettingStartSleepChar), FontStyle::LARGE);
break;
case 3:
case autoStartMode_t::ZERO:
OLED::print(translatedString(Tr->SettingStartSleepOffChar), FontStyle::LARGE);
break;
default:
Expand Down
7 changes: 1 addition & 6 deletions source/Core/Threads/OperatingModes/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
currentTempTargetDegC = stayOff ? 0 : min(getSettingValue(SettingsOptions::SleepTemp), getSettingValue(SettingsOptions::SolderingTemp));
}
// draw the lcd
uint16_t tipTemp;
if (getSettingValue(SettingsOptions::TemperatureInF))
tipTemp = TipThermoModel::getTipInF();
else {
tipTemp = TipThermoModel::getTipInC();
}
uint16_t tipTemp = getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC();

OLED::clearScreen();
OLED::setCursor(0, 0);
Expand Down