mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Merge branch 'dev' into gui-multi-screen
This commit is contained in:
@@ -107,13 +107,13 @@
|
||||
},
|
||||
"menuValues": {
|
||||
"USBPDModeDefault": {
|
||||
"displayText": "Default\nMode"
|
||||
"displayText": "\nРэжым"
|
||||
},
|
||||
"USBPDModeNoDynamic": {
|
||||
"displayText": "No\nDynamic"
|
||||
"displayText": "Няма\nдынамікі"
|
||||
},
|
||||
"USBPDModeSafe": {
|
||||
"displayText": "Safe\nMode"
|
||||
"displayText": "Бяспечны\nрэжым"
|
||||
}
|
||||
},
|
||||
"menuOptions": {
|
||||
@@ -134,7 +134,7 @@
|
||||
"description": "Час чакання ўзгаднення PD з крокам 100 мс для сумяшчальнасці з некаторымі зараднымі зараднымі прыладамі QC (0: адключана)"
|
||||
},
|
||||
"USBPDMode": {
|
||||
"displayText": "PD\nMode",
|
||||
"displayText": "PD\nРэжым",
|
||||
"description": "Уключае рэжымы PPS & EPR."
|
||||
},
|
||||
"BoostTemperature": {
|
||||
@@ -158,59 +158,59 @@
|
||||
"description": "Пры рабоце падоўжаны націск дзьвух кнопак блакуе іх (Т=Толькі турба | П=Поўная блакіроўка)"
|
||||
},
|
||||
"ProfilePhases": {
|
||||
"displayText": "Profile\nPhases",
|
||||
"displayText": "Фазы\nпрофілю",
|
||||
"description": "Колькасць фаз у рэжыме профілю"
|
||||
},
|
||||
"ProfilePreheatTemp": {
|
||||
"displayText": "Preheat\nTemp",
|
||||
"displayText": "Тэмпература\nразагравання",
|
||||
"description": "Разагрэйце да гэтай тэмпературы ў пачатку профільнага рэжыму"
|
||||
},
|
||||
"ProfilePreheatSpeed": {
|
||||
"displayText": "Preheat\nSpeed",
|
||||
"displayText": "Хуткасть\nразагравання",
|
||||
"description": "Разагрэйце з гэтай хуткасцю (градусы ў секунду)"
|
||||
},
|
||||
"ProfilePhase1Temp": {
|
||||
"displayText": "Phase 1\nTemp",
|
||||
"displayText": "Фаза 1\nтэмпература",
|
||||
"description": "Мэтавая тэмпература ў канцы гэтай фазы"
|
||||
},
|
||||
"ProfilePhase1Duration": {
|
||||
"displayText": "Phase 1\nDuration",
|
||||
"displayText": "Фаза 1\nпрацягласць",
|
||||
"description": "Мэтавая працягласць гэтай фазы (секунды)"
|
||||
},
|
||||
"ProfilePhase2Temp": {
|
||||
"displayText": "Phase 2\nTemp",
|
||||
"description": ""
|
||||
"displayText": "Фаза 2\nтэмпература",
|
||||
"description": "Мэтавая тэмпература ў канцы гэтай фазы"
|
||||
},
|
||||
"ProfilePhase2Duration": {
|
||||
"displayText": "Phase 2\nDuration",
|
||||
"description": ""
|
||||
"displayText": "Фаза 2\nпрацягласць",
|
||||
"description": "Мэтавая працягласць гэтай фазы (секунды)"
|
||||
},
|
||||
"ProfilePhase3Temp": {
|
||||
"displayText": "Phase 3\nTemp",
|
||||
"description": ""
|
||||
"displayText": "Фаза 3\nтэмпература",
|
||||
"description": "Мэтавая тэмпература ў канцы гэтай фазы"
|
||||
},
|
||||
"ProfilePhase3Duration": {
|
||||
"displayText": "Phase 3\nDuration",
|
||||
"description": ""
|
||||
"displayText": "Фаза 3\nпрацягласць",
|
||||
"description": "Мэтавая працягласць гэтай фазы (секунды)"
|
||||
},
|
||||
"ProfilePhase4Temp": {
|
||||
"displayText": "Phase 4\nTemp",
|
||||
"description": ""
|
||||
"displayText": "Фаза 4\nтэмпература",
|
||||
"description": "Мэтавая тэмпература ў канцы гэтай фазы"
|
||||
},
|
||||
"ProfilePhase4Duration": {
|
||||
"displayText": "Phase 4\nDuration",
|
||||
"description": ""
|
||||
"displayText": "Фаза 4\nпрацягласць",
|
||||
"description": "Мэтавая працягласць гэтай фазы (секунды)"
|
||||
},
|
||||
"ProfilePhase5Temp": {
|
||||
"displayText": "Phase 5\nTemp",
|
||||
"description": ""
|
||||
"displayText": "Фаза 5\nтэмпература",
|
||||
"description": "Мэтавая тэмпература ў канцы гэтай фазы"
|
||||
},
|
||||
"ProfilePhase5Duration": {
|
||||
"displayText": "Phase 5\nDuration",
|
||||
"description": ""
|
||||
"displayText": "Фаза 5\nпрацягласць",
|
||||
"description": "Мэтавая працягласць гэтай фазы (секунды)"
|
||||
},
|
||||
"ProfileCooldownSpeed": {
|
||||
"displayText": "Cooldown\nSpeed",
|
||||
"displayText": "Хуткасць\nастывання",
|
||||
"description": "Астуджаць з гэтай хуткасцю ў канцы профільнага рэжыму (градусы ў секунду)"
|
||||
},
|
||||
"MotionSensitivity": {
|
||||
|
||||
@@ -107,13 +107,13 @@
|
||||
},
|
||||
"menuValues": {
|
||||
"USBPDModeDefault": {
|
||||
"displayText": "Default\nMode"
|
||||
"displayText": "Вкл.\nPPSиERP"
|
||||
},
|
||||
"USBPDModeNoDynamic": {
|
||||
"displayText": "No\nDynamic"
|
||||
"displayText": "Изкл.\n"
|
||||
},
|
||||
"USBPDModeSafe": {
|
||||
"displayText": "Safe\nMode"
|
||||
"displayText": "Вкл.без\nискане"
|
||||
}
|
||||
},
|
||||
"menuOptions": {
|
||||
@@ -134,8 +134,8 @@
|
||||
"description": "PD интервал за договаряне на захранването на стъпки от 100 мс за съвместимост с някои QC захранвания (0=Изкл.)"
|
||||
},
|
||||
"USBPDMode": {
|
||||
"displayText": "PD\nMode",
|
||||
"description": "Включи PPS & EPR"
|
||||
"displayText": "PD\nрежим",
|
||||
"description": "Вкл.без искане: включи PPS и EPR без да искате повече мощност"
|
||||
},
|
||||
"BoostTemperature": {
|
||||
"displayText": "Турбо\nтемп.",
|
||||
|
||||
@@ -107,13 +107,13 @@
|
||||
},
|
||||
"menuValues": {
|
||||
"USBPDModeDefault": {
|
||||
"displayText": "Default\nMode"
|
||||
"displayText": "Modo\npredefinito"
|
||||
},
|
||||
"USBPDModeNoDynamic": {
|
||||
"displayText": "No\nDynamic"
|
||||
"displayText": "Modo\nstatico"
|
||||
},
|
||||
"USBPDModeSafe": {
|
||||
"displayText": "Safe\nMode"
|
||||
"displayText": "Modo\nsicuro"
|
||||
}
|
||||
},
|
||||
"menuOptions": {
|
||||
|
||||
@@ -107,13 +107,13 @@
|
||||
},
|
||||
"menuValues": {
|
||||
"USBPDModeDefault": {
|
||||
"displayText": "Default\nMode"
|
||||
"displayText": "Вкл.\nPPSиEPR"
|
||||
},
|
||||
"USBPDModeNoDynamic": {
|
||||
"displayText": "No\nDynamic"
|
||||
"displayText": "Откл.\n"
|
||||
},
|
||||
"USBPDModeSafe": {
|
||||
"displayText": "Safe\nMode"
|
||||
"displayText": "Вкл.без\nзапроса"
|
||||
}
|
||||
},
|
||||
"menuOptions": {
|
||||
@@ -130,12 +130,12 @@
|
||||
"description": "Максимальное напряжение для согласования с источником питания по QC"
|
||||
},
|
||||
"PDNegTimeout": {
|
||||
"displayText": "PD\nинтервал",
|
||||
"displayText": "Интервал\nPD",
|
||||
"description": "Интервал согласования питания по Power Delivery с шагом 100 мс для совместимости с некоторыми источниками питания по QC (0=Откл.)"
|
||||
},
|
||||
"USBPDMode": {
|
||||
"displayText": "PD\nMode",
|
||||
"description": "Включить режимы PPS & EPR"
|
||||
"displayText": "Режим\nPD",
|
||||
"description": "Вкл.без запроса: включить PPS и EPR без запроса большей мощности"
|
||||
},
|
||||
"BoostTemperature": {
|
||||
"displayText": "t° турбо\nрежима",
|
||||
|
||||
@@ -158,7 +158,7 @@ void FS2711::negotiate() {
|
||||
// FS2711 uses mV instead of V
|
||||
const uint16_t vmax = USB_PD_VMAX * 1000;
|
||||
uint8_t tip_resistance = getTipResistanceX10();
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
||||
tip_resistance += 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ public:
|
||||
static void drawBattery(uint8_t state) { drawSymbol(3 + (state > 10 ? 10 : state)); }
|
||||
// Draws a checkbox
|
||||
static void drawCheckbox(bool state) { drawSymbol((state) ? 16 : 17); }
|
||||
inline static void drawUnavailableIcon() { drawArea(OLED_WIDTH - 16 - 2, 0, 16, 16, UnavailableIcon); }
|
||||
static void debugNumber(int32_t val, FontStyle fontStyle);
|
||||
static void drawHex(uint32_t x, FontStyle fontStyle, uint8_t digits);
|
||||
static void drawSymbol(uint8_t symbolID); // Used for drawing symbols of a predictable width
|
||||
|
||||
@@ -136,7 +136,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
||||
|
||||
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
|
||||
uint8_t tipResistance = getTipResistanceX10();
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
||||
tipResistance += 5;
|
||||
}
|
||||
#ifdef MODEL_HAS_DCDC
|
||||
|
||||
@@ -23,7 +23,7 @@ int32_t Utils::LinearInterpolate(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
|
||||
|
||||
uint16_t Utils::RequiredCurrentForTipAtVoltage(uint16_t voltageX10) {
|
||||
uint8_t tipResistancex10 = getTipResistanceX10();
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
||||
tipResistancex10 += 5;
|
||||
}
|
||||
#ifdef MODEL_HAS_DCDC
|
||||
@@ -34,4 +34,4 @@ uint16_t Utils::RequiredCurrentForTipAtVoltage(uint16_t voltageX10) {
|
||||
// V/R = I
|
||||
uint16_t currentX10 = (voltageX10 * 10) / tipResistancex10;
|
||||
return currentX10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,12 @@ typedef enum {
|
||||
INFINITY = 6, // Show boot logo on repeat (if animated) until a button toggled
|
||||
} logoMode_t;
|
||||
|
||||
typedef enum {
|
||||
DEFAULT = 1, // PPS + EPR + more power request through increasing resistance by 0.5 Ohm to compensate power loss over cable/PCB/etc.
|
||||
SAFE = 2, // PPS + EPR, without requesting more power
|
||||
NO_DYNAMIC = 0, // PPS + EPR disabled, fixed PDO only
|
||||
} usbpdMode_t;
|
||||
|
||||
// Settings wide operations
|
||||
void saveSettings();
|
||||
bool loadSettings();
|
||||
|
||||
@@ -524,28 +524,25 @@ static void displayQCInputV(void) {
|
||||
|
||||
static void displayPDNegTimeout(void) {
|
||||
auto value = getSettingValue(SettingsOptions::PDNegTimeout);
|
||||
if (value == 0) {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
} else {
|
||||
OLED::printNumber(value, 2, FontStyle::LARGE);
|
||||
}
|
||||
value ? OLED::printNumber(value, 2, FontStyle::LARGE) : OLED::drawUnavailableIcon();
|
||||
}
|
||||
|
||||
static void displayUSBPDMode(void) {
|
||||
/*
|
||||
* PD Mode
|
||||
* 0 = Safe mode, no PPS, no EPR
|
||||
* 1 = Default mode, tolerant + PPS + EPR
|
||||
* 2 = Strict mode + PPS + EPR
|
||||
* Supported PD modes:
|
||||
* DEFAULT, 1 = PPS + EPR + more power request through increasing resistance by 0.5 Ohm to compensate power loss over cable/PCB/etc.
|
||||
* SAFE, 2 = PPS + EPR, without requesting more power
|
||||
* NO_DYNAMIC, 0 = PPS + EPR disabled, fixed PDO only
|
||||
*/
|
||||
|
||||
switch (getSettingValue(SettingsOptions::USBPDMode)) {
|
||||
case 1:
|
||||
case usbpdMode_t::DEFAULT:
|
||||
OLED::print(translatedString(Tr->USBPDModeDefault), FontStyle::SMALL, 255, OLED::getCursorX());
|
||||
break;
|
||||
case 2:
|
||||
case usbpdMode_t::SAFE:
|
||||
OLED::print(translatedString(Tr->USBPDModeSafe), FontStyle::SMALL, 255, OLED::getCursorX());
|
||||
break;
|
||||
case usbpdMode_t::NO_DYNAMIC:
|
||||
default:
|
||||
OLED::print(translatedString(Tr->USBPDModeNoDynamic), FontStyle::SMALL, 255, OLED::getCursorX());
|
||||
break;
|
||||
@@ -584,14 +581,14 @@ static void displayBoostTemp(void) {
|
||||
if (getSettingValue(SettingsOptions::BoostTemp)) {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::BoostTemp), 3, FontStyle::LARGE);
|
||||
} else {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
}
|
||||
}
|
||||
|
||||
static void displayAutomaticStartMode(void) {
|
||||
switch (getSettingValue(SettingsOptions::AutoStartMode)) {
|
||||
case autoStartMode_t::NO:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
case autoStartMode_t::SOLDER:
|
||||
OLED::print(translatedString(Tr->SettingStartSolderingChar), FontStyle::LARGE);
|
||||
@@ -603,7 +600,7 @@ static void displayAutomaticStartMode(void) {
|
||||
OLED::print(translatedString(Tr->SettingStartSleepOffChar), FontStyle::LARGE);
|
||||
break;
|
||||
default:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -615,7 +612,7 @@ static void displayTempChangeLongStep(void) { OLED::printNumber(getSettingValue(
|
||||
static void displayLockingMode(void) {
|
||||
switch (getSettingValue(SettingsOptions::LockingMode)) {
|
||||
case 0:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
case 1:
|
||||
OLED::print(translatedString(Tr->SettingLockBoostChar), FontStyle::LARGE);
|
||||
@@ -624,7 +621,7 @@ static void displayLockingMode(void) {
|
||||
OLED::print(translatedString(Tr->SettingLockFullChar), FontStyle::LARGE);
|
||||
break;
|
||||
default:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -684,7 +681,7 @@ static void displaySensitivity(void) {
|
||||
if (getSettingValue(SettingsOptions::Sensitivity)) {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::Sensitivity), 1, FontStyle::LARGE, false);
|
||||
} else {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
}
|
||||
}
|
||||
static bool showSleepOptions(void) { return getSettingValue(SettingsOptions::Sensitivity) > 0; }
|
||||
@@ -713,7 +710,7 @@ static void displaySleepTemp(void) { OLED::printNumber(getSettingValue(SettingsO
|
||||
|
||||
static void displaySleepTime(void) {
|
||||
if (getSettingValue(SettingsOptions::SleepTime) == 0) {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
} else if (getSettingValue(SettingsOptions::SleepTime) < 6) {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::SleepTime) * 10, 2, FontStyle::LARGE);
|
||||
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
|
||||
@@ -727,7 +724,7 @@ static void displaySleepTime(void) {
|
||||
|
||||
static void displayShutdownTime(void) {
|
||||
if (getSettingValue(SettingsOptions::ShutdownTime) == 0) {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
} else {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::ShutdownTime), 2, FontStyle::LARGE);
|
||||
OLED::print(LargeSymbolMinutes, FontStyle::LARGE);
|
||||
@@ -739,7 +736,7 @@ static void displayHallEffect(void) {
|
||||
if (getSettingValue(SettingsOptions::HallEffectSensitivity)) {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::HallEffectSensitivity), 1, FontStyle::LARGE, false);
|
||||
} else {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
}
|
||||
}
|
||||
static bool showHallEffect(void) { return getHallSensorFitted(); }
|
||||
@@ -837,7 +834,7 @@ static void displayAnimationSpeed(void) {
|
||||
OLED::print(translatedString(Tr->SettingFastChar), FontStyle::LARGE);
|
||||
break;
|
||||
default:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -860,7 +857,7 @@ static void displayInvertColor(void) {
|
||||
static void displayLogoTime(void) {
|
||||
switch (getSettingValue(SettingsOptions::LOGOTime)) {
|
||||
case logoMode_t::SKIP:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
break;
|
||||
case logoMode_t::ONETIME:
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, RepeatOnce);
|
||||
@@ -885,7 +882,7 @@ static void displayBluetoothLE(void) { OLED::drawCheckbox(getSettingValue(Settin
|
||||
|
||||
static void displayPowerLimit(void) {
|
||||
if (getSettingValue(SettingsOptions::PowerLimit) == 0) {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
} else {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::PowerLimit), 3, FontStyle::LARGE);
|
||||
OLED::print(LargeSymbolWatts, FontStyle::LARGE);
|
||||
@@ -953,7 +950,7 @@ static void displayPowerPulse(void) {
|
||||
OLED::print(LargeSymbolDot, FontStyle::LARGE);
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::KeepAwakePulse) % 10, 1, FontStyle::LARGE);
|
||||
} else {
|
||||
OLED::drawArea(OLED_WIDTH - OLED_HEIGHT - 2, 0, OLED_HEIGHT, OLED_HEIGHT, UnavailableIcon);
|
||||
OLED::drawUnavailableIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user