mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Add enum for modes of locking buttons (#1955)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_readme (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_readme (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
* Add enum for modes of locking buttons * Update description for FULL value
This commit is contained in:
@@ -110,6 +110,12 @@ typedef enum {
|
||||
NO_DYNAMIC = 0, // PPS + EPR disabled, fixed PDO only
|
||||
} usbpdMode_t;
|
||||
|
||||
typedef enum {
|
||||
DISABLED = 0, // Locking buttons is disabled
|
||||
BOOST = 1, // Locking buttons for Boost mode only
|
||||
FULL = 2, // Locking buttons for Boost mode AND for Soldering mode
|
||||
} lockingMode_t;
|
||||
|
||||
// Settings wide operations
|
||||
void saveSettings();
|
||||
bool loadSettings();
|
||||
|
||||
@@ -611,13 +611,13 @@ static void displayTempChangeLongStep(void) { OLED::printNumber(getSettingValue(
|
||||
|
||||
static void displayLockingMode(void) {
|
||||
switch (getSettingValue(SettingsOptions::LockingMode)) {
|
||||
case 0:
|
||||
case lockingMode_t::DISABLED:
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
case 1:
|
||||
case lockingMode_t::BOOST:
|
||||
OLED::print(translatedString(Tr->SettingLockBoostChar), FontStyle::LARGE);
|
||||
break;
|
||||
case 2:
|
||||
case lockingMode_t::FULL:
|
||||
OLED::print(translatedString(Tr->SettingLockFullChar), FontStyle::LARGE);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -10,7 +10,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
|
||||
if (cxt->scratch_state.state1 == 1) {
|
||||
// Buttons are currently locked
|
||||
if (buttons == BUTTON_F_LONG) {
|
||||
if (getSettingValue(SettingsOptions::BoostTemp) && (getSettingValue(SettingsOptions::LockingMode) == 1)) {
|
||||
if (getSettingValue(SettingsOptions::BoostTemp) && (getSettingValue(SettingsOptions::LockingMode) == lockingMode_t::BOOST)) {
|
||||
cxt->scratch_state.state2 = 1;
|
||||
}
|
||||
} else if (buttons == BUTTON_BOTH_LONG) {
|
||||
@@ -45,11 +45,9 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
|
||||
cxt->transitionMode = TransitionAnimation::Left;
|
||||
return OperatingMode::TemperatureAdjust;
|
||||
case BUTTON_BOTH_LONG:
|
||||
if (getSettingValue(SettingsOptions::LockingMode) != 0) {
|
||||
if (getSettingValue(SettingsOptions::LockingMode) && warnUser(translatedString(Tr->LockingKeysString), buttons)) {
|
||||
// Lock buttons
|
||||
if (warnUser(translatedString(Tr->LockingKeysString), buttons)) {
|
||||
cxt->scratch_state.state1 = 1;
|
||||
}
|
||||
cxt->scratch_state.state1 = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -57,6 +55,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
|
||||
}
|
||||
return OperatingMode::Soldering;
|
||||
}
|
||||
|
||||
OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
|
||||
/*
|
||||
* * Soldering (gui_solderingMode)
|
||||
|
||||
Reference in New Issue
Block a user