Skip to content

Commit

Permalink
Style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim committed Jul 21, 2023
1 parent e3b4cbc commit 04a1a90
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
3 changes: 2 additions & 1 deletion source/Core/Threads/OperatingModes/DebugMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ OperatingMode showDebugMenu(const ButtonState buttons, guiContext *cxt) {
case 16: // Raw Hall Effect Value
{
int16_t hallEffectStrength = getRawHallEffect();
if (hallEffectStrength < 0)
if (hallEffectStrength < 0) {
hallEffectStrength = -hallEffectStrength;
}
OLED::printNumber(hallEffectStrength, 6, FontStyle::SMALL);
} break;
#endif
Expand Down
7 changes: 4 additions & 3 deletions source/Core/Threads/OperatingModes/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ OperatingMode gui_SolderingSleepingMode(const ButtonState buttons, guiContext *c
// If in the first two seconds we disable this to let accelerometer warm up

#ifdef POW_DC
if (checkForUnderVoltage())
if (checkForUnderVoltage()) {
return OperatingMode::HomeScreen; // return non-zero on error
}
#endif
if (getSettingValue(SettingsOptions::TemperatureInF)) {
currentTempTargetDegC = TipThermoModel::convertFtoC(min(getSettingValue(SettingsOptions::SleepTemp), getSettingValue(SettingsOptions::SolderingTemp)));
Expand All @@ -28,9 +29,9 @@ OperatingMode gui_SolderingSleepingMode(const ButtonState buttons, guiContext *c
OLED::setCursor(0, 8);
OLED::print(translatedString(Tr->SleepingTipAdvancedString), FontStyle::SMALL);
OLED::printNumber(tipTemp, 3, FontStyle::SMALL);
if (getSettingValue(SettingsOptions::TemperatureInF))
if (getSettingValue(SettingsOptions::TemperatureInF)) {
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
else {
} else {
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
}

Expand Down
8 changes: 4 additions & 4 deletions source/Core/Threads/OperatingModes/Soldering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {

// Update the setpoints for the temperature
if (cxt->scratch_state.state2) {
if (getSettingValue(SettingsOptions::TemperatureInF))
if (getSettingValue(SettingsOptions::TemperatureInF)) {
currentTempTargetDegC = TipThermoModel::convertFtoC(getSettingValue(SettingsOptions::BoostTemp));
else {
} else {
currentTempTargetDegC = (getSettingValue(SettingsOptions::BoostTemp));
}
} else {
if (getSettingValue(SettingsOptions::TemperatureInF))
if (getSettingValue(SettingsOptions::TemperatureInF)) {
currentTempTargetDegC = TipThermoModel::convertFtoC(getSettingValue(SettingsOptions::SolderingTemp));
else {
} else {
currentTempTargetDegC = (getSettingValue(SettingsOptions::SolderingTemp));
}
}
Expand Down
5 changes: 3 additions & 2 deletions source/Core/Threads/OperatingModes/SolderingProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@ OperatingMode gui_solderingProfileMode(const ButtonState buttons, guiContext *cx
OLED::print(SmallSymbolSlash, FontStyle::SMALL);
OLED::printNumber(profileCurrentTargetTemp, 3, FontStyle::SMALL);

if (getSettingValue(SettingsOptions::TemperatureInF))
if (getSettingValue(SettingsOptions::TemperatureInF)) {
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
else
} else {
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
}

// print phase
if (cxt->scratch_state.state1 > 0 && cxt->scratch_state.state1 <= getSettingValue(SettingsOptions::ProfilePhases)) {
Expand Down
10 changes: 6 additions & 4 deletions source/Core/Threads/OperatingModes/TemperatureAdjust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@ OperatingMode gui_solderingTempAdjust(const ButtonState buttonIn, guiContext *cx
newTemp = (newTemp / delta) * delta;

if (getSettingValue(SettingsOptions::TemperatureInF)) {
if (newTemp > MAX_TEMP_F)
if (newTemp > MAX_TEMP_F) {
newTemp = MAX_TEMP_F;
if (newTemp < MIN_TEMP_F)
} else if (newTemp < MIN_TEMP_F) {
newTemp = MIN_TEMP_F;
}
} else {
if (newTemp > MAX_TEMP_C)
if (newTemp > MAX_TEMP_C) {
newTemp = MAX_TEMP_C;
if (newTemp < MIN_TEMP_C)
} else if (newTemp < MIN_TEMP_C) {
newTemp = MIN_TEMP_C;
}
}
setSettingValue(SettingsOptions::SolderingTemp, (uint16_t)newTemp);
}
Expand Down
4 changes: 2 additions & 2 deletions source/Core/Threads/OperatingModes/USBPDDebug_FUSB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ OperatingMode showPDDebug(const ButtonState buttons, guiContext *cxt) {
(*screen) = 0;
}
}
if (buttons == BUTTON_B_SHORT)
if (buttons == BUTTON_B_SHORT) {
return OperatingMode::InitialisationDone;
else if (buttons == BUTTON_F_SHORT) {
} else if (buttons == BUTTON_F_SHORT) {
(*screen) += 1;
}
return OperatingMode::UsbPDDebug;
Expand Down

0 comments on commit 04a1a90

Please sign in to comment.