* 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>
73 lines
1.9 KiB
C++
73 lines
1.9 KiB
C++
|
|
#include "Buttons.hpp"
|
|
#include "OperatingModes.h"
|
|
#include "ui_drawing.hpp"
|
|
|
|
bool showExitMenuTransition = false;
|
|
|
|
OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
|
|
if (buttons != BUTTON_NONE && cxt->scratch_state.state1 == 0) {
|
|
return OperatingMode::HomeScreen; // Ignore button press
|
|
} else {
|
|
cxt->scratch_state.state1 = 1;
|
|
}
|
|
switch (buttons) {
|
|
case BUTTON_NONE:
|
|
// Do nothing
|
|
break;
|
|
case BUTTON_BOTH:
|
|
break;
|
|
|
|
case BUTTON_B_LONG:
|
|
cxt->transitionMode = TransitionAnimation::Up;
|
|
return OperatingMode::DebugMenuReadout;
|
|
break;
|
|
case BUTTON_F_LONG:
|
|
#ifdef PROFILE_SUPPORT
|
|
if (!isTipDisconnected()) {
|
|
cxt->transitionMode = TransitionAnimation::Left;
|
|
return OperatingMode::SolderingProfile;
|
|
} else {
|
|
return OperatingMode::HomeScreen;
|
|
}
|
|
#else
|
|
cxt->transitionMode = TransitionAnimation::Left;
|
|
return OperatingMode::TemperatureAdjust;
|
|
#endif
|
|
break;
|
|
case BUTTON_F_SHORT:
|
|
if (!isTipDisconnected()) {
|
|
cxt->transitionMode = TransitionAnimation::Left;
|
|
return OperatingMode::Soldering;
|
|
}
|
|
break;
|
|
case BUTTON_B_SHORT:
|
|
cxt->transitionMode = TransitionAnimation::Right;
|
|
return OperatingMode::SettingsMenu;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return OperatingMode::HomeScreen;
|
|
}
|
|
|
|
OperatingMode drawHomeScreen(const ButtonState buttons, guiContext *cxt) {
|
|
|
|
currentTempTargetDegC = 0; // ensure tip is off
|
|
getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
|
|
uint32_t tipTemp = TipThermoModel::getTipInC();
|
|
|
|
// Setup LCD Cursor location
|
|
if (OLED::getRotation()) {
|
|
OLED::setCursor(50, 0);
|
|
} else {
|
|
OLED::setCursor(-1, 0);
|
|
}
|
|
if (getSettingValue(SettingsOptions::DetailedIDLE)) {
|
|
ui_draw_homescreen_detailed(tipTemp);
|
|
} else {
|
|
ui_draw_homescreen_simplified(tipTemp);
|
|
}
|
|
return handleHomeButtons(buttons, cxt);
|
|
}
|