mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
* Create README.md * Move to new folder * Migrating * Migrate Remainder * format fix (all but one) (#1889) * Update USBPDDebug_FS2711.cpp * Delete PrintVoltage.cpp * Copy in 128x32 template * Mask drawing for 96x16 * Import #1819 * Update Font.h * Homescreen * Update draw_homescreen_detailed.cpp * Fix oled normal draw for variable height * Update OLED.cpp * Draw settings icons * Update draw_homescreen_simplified.cpp * Update draw_power_source_icon.cpp * Fixup oled drawing for fill area * Update the region fill for mixed heights * Fix newline height * FIXUP! Draw icons in settings menu at correct size * Fix scrollbar * Update settingsGUI.cpp * S60(P) Disable auto display rotation * On tall oled, scroll in 2 line increments * Bugfix transition L<->R @discip I take it back, there was a bug :) * Draw every other one on transitions * . * cleanup * Bootup logo: Draw in centre * Update OLED.hpp --------- Co-authored-by: discip <53649486+discip@users.noreply.github.com>
52 lines
1.6 KiB
C++
52 lines
1.6 KiB
C++
#include "OperatingModes.h"
|
|
#include "ui_drawing.hpp"
|
|
OperatingMode gui_SolderingSleepingMode(const ButtonState buttons, guiContext *cxt) {
|
|
#ifdef NO_SLEEP_MODE
|
|
return OperatingMode::Soldering;
|
|
#endif
|
|
// Drop to sleep temperature and display until movement or button press
|
|
|
|
// user moved or pressed a button, go back to soldering
|
|
// If in the first two seconds we disable this to let accelerometer warm up
|
|
|
|
#ifdef POW_DC
|
|
if (checkForUnderVoltage()) {
|
|
return OperatingMode::HomeScreen; // return non-zero on error
|
|
}
|
|
#endif
|
|
|
|
if (cxt->scratch_state.state4) {
|
|
// Hibernating mode
|
|
currentTempTargetDegC = 0;
|
|
} else {
|
|
if (getSettingValue(SettingsOptions::TemperatureInF)) {
|
|
currentTempTargetDegC = TipThermoModel::convertFtoC(min(getSettingValue(SettingsOptions::SleepTemp), getSettingValue(SettingsOptions::SolderingTemp)));
|
|
} else {
|
|
currentTempTargetDegC = min(getSettingValue(SettingsOptions::SleepTemp), getSettingValue(SettingsOptions::SolderingTemp));
|
|
}
|
|
}
|
|
// draw the lcd
|
|
uint16_t tipTemp = getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC();
|
|
|
|
if (getSettingValue(SettingsOptions::DetailedSoldering)) {
|
|
ui_draw_soldering_detailed_sleep(tipTemp);
|
|
} else {
|
|
ui_draw_soldering_basic_sleep(tipTemp);
|
|
}
|
|
|
|
if (!shouldBeSleeping()) {
|
|
return cxt->previousMode;
|
|
}
|
|
|
|
if (shouldShutdown()) {
|
|
// shutdown
|
|
currentTempTargetDegC = 0;
|
|
return OperatingMode::HomeScreen;
|
|
}
|
|
if (cxt->scratch_state.state4) {
|
|
return OperatingMode::Hibernating;
|
|
} else {
|
|
return OperatingMode::Sleeping;
|
|
}
|
|
}
|