diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index bbb28606..e36fdfe4 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -224,6 +224,13 @@ ], "desc": "Мощност на избраното захранване" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Лимит на", diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index 8088bbff..18c63c18 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -223,6 +223,13 @@ ], "desc": "Výkon použítého napájecího adaptéru ve wattech." }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Omezení", diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index 38e2f38e..29f3f089 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -223,6 +223,13 @@ ], "desc": "Power Wattage of the power adapter used" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index 29a8cd3b..83600ae3 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -224,6 +224,13 @@ ], "desc": "Maximal zulässige Spannung der verwendeten Spannungsversorgung (V=Volt)" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Leistungs-", diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index a4b024f1..593a2c61 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -223,6 +223,13 @@ ], "desc": "Max QC voltage the iron should negotiate for" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index 09bf4d47..ef7f1f62 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -224,6 +224,13 @@ ], "desc": "Potencia en vatios del adaptador de corriente utilizado." }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Ajustar la", diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index 399b050d..f8fea9ed 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -222,6 +222,13 @@ ], "desc": "Ensisijainen maksimi QC jännite" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Tehon-", diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index a5b430f5..073de1bd 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -223,6 +223,13 @@ ], "desc": "Tension maximale désirée avec une alimentation QC" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Limite de", diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index 350c3789..72055c32 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -223,6 +223,13 @@ ], "desc": "Snaga modula za napajanje" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index 5873fe34..6707082f 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -226,6 +226,13 @@ ], "desc": "Maximális USB feszültség (QuickCharge)" }, + "PDNegTimeout": { + "text2": [ + "PD", + "időtúllépés" + ], + "desc": "PD egyeztetési leidőzítés 100ms lépésekben megadva néhány QC töltővel való kompatibilitás érdekében (0: kikapcsolva)" + }, "PowerLimit": { "text2": [ "Teljesítmény", diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index 5862de1f..8c34ddec 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -223,6 +223,13 @@ ], "desc": "Imposta il massimo voltaggio negoziabile con un alimentatore Quick Charge" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Limite", diff --git a/Translations/translation_JA_JP.json b/Translations/translation_JA_JP.json index 374d8fd0..c0fd7fd6 100644 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -155,6 +155,13 @@ "text2": "QC電圧", "desc": "QC電源使用時に要求する目標電圧" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": "電力制限", "desc": "はんだ付てが使用できる最大電力を制限する " diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index dc4b9e87..95882932 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -223,6 +223,13 @@ ], "desc": "Maksimali QC maitinimo bloko įtampa" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Galios", diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index abb4f5f9..6133bc45 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -223,6 +223,13 @@ ], "desc": "Wattage van de gebruikte voeding" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Vermogen", diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index 0ea0a525..87cfd5c1 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -223,6 +223,13 @@ ], "desc": "Vermogen van de adapter" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_NO.json b/Translations/translation_NO.json index 68a3edfc..4916c965 100644 --- a/Translations/translation_NO.json +++ b/Translations/translation_NO.json @@ -223,6 +223,13 @@ ], "desc": "Power Wattage of the power adapter used" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index 5eed150e..39019fce 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -224,6 +224,13 @@ ], "desc": "Moc używanego zasilacza w (W)" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Ogr.", diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index 1a8a8136..fe95523c 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -223,6 +223,13 @@ ], "desc": "Potência da fonte usada (Watt)" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 1b03e5c5..5ec240b2 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -224,6 +224,13 @@ ], "desc": "Мощность используемого источника питания" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Предел", diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index c9e82813..7bd82fd8 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -223,6 +223,13 @@ ], "desc": "Obmedzenie výkonu podľa použitého zdroja" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Obmedzenie", diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 02c64e45..69170f18 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -223,6 +223,13 @@ ], "desc": "Moč napajalnega vira v vatih [W]" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Meja", diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index fd55b588..464dfb0d 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -223,6 +223,13 @@ ], "desc": "Снага напајања у ватима." }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index df5599fd..6ad42ad7 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -223,6 +223,13 @@ ], "desc": "Snaga napajanja u vatima." }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Power", diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index 358bf379..6c850d69 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -217,6 +217,13 @@ ], "desc": "Maximal QC-spänning enheten skall efterfråga" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Max-", diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index cfec4a11..8a2dc4d1 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -233,6 +233,13 @@ ], "desc": "Desired max QC Voltage negotiated for" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerInput": { "text2": [ "Güç", diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index ea20a150..604853ab 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -224,6 +224,13 @@ ], "desc": "Потужність джерела живлення в Ватах" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": [ "Макс.", diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index c595a25d..7f9d6d0e 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -155,6 +155,13 @@ "text2": "QC電壓", "desc": "使用QC電源時請求嘅最高目標電壓" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": "功率限制", "desc": "限制辣雞可用嘅最大功率 " diff --git a/Translations/translation_ZH_CN.json b/Translations/translation_ZH_CN.json index 78a21520..3627a186 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -155,6 +155,13 @@ "text2": "QC电压", "desc": "使用QC电源时请求的最高目标电压" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": "功率限制", "desc": "限制铬铁可用的最大功率 " diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 7f8d6936..a943ab4a 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -156,6 +156,13 @@ "text2": "QC電壓", "desc": "使用QC電源時請求的最高目標電壓" }, + "PDNegTimeout": { + "text2": [ + "PD", + "timeout" + ], + "desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)" + }, "PowerLimit": { "text2": "功率限制", "desc": "限制鉻鐵可用的最大功率 " diff --git a/Translations/translations_def.js b/Translations/translations_def.js index d2ecd5f6..e25b02db 100644 --- a/Translations/translations_def.js +++ b/Translations/translations_def.js @@ -283,6 +283,12 @@ var def = "maxLen": 8, "maxLen2": 16 }, + { + "id": "PDNegTimeout", + "maxLen": 8, + "maxLen2": 16 + }, + { "id": "PowerLimit", "maxLen": 5, diff --git a/source/Core/BSP/MHP30/Power.cpp b/source/Core/BSP/MHP30/Power.cpp index 95dd26e3..401b370e 100644 --- a/source/Core/BSP/MHP30/Power.cpp +++ b/source/Core/BSP/MHP30/Power.cpp @@ -16,7 +16,7 @@ void power_check() { if (FUSB302_present) { PolicyEngine::PPSTimerCallback(); // Cant start QC until either PD works or fails - if (PolicyEngine::setupCompleteOrTimedOut() == false) { + if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) { return; } if (PolicyEngine::pdHasNegotiated()) { diff --git a/source/Core/BSP/Miniware/Power.cpp b/source/Core/BSP/Miniware/Power.cpp index 8cbee738..8b7c8eb3 100644 --- a/source/Core/BSP/Miniware/Power.cpp +++ b/source/Core/BSP/Miniware/Power.cpp @@ -16,7 +16,7 @@ void power_check() { if (FUSB302_present) { PolicyEngine::PPSTimerCallback(); // Cant start QC until either PD works or fails - if (PolicyEngine::setupCompleteOrTimedOut() == false) { + if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) { return; } if (PolicyEngine::pdHasNegotiated()) { diff --git a/source/Core/BSP/Pine64/Power.cpp b/source/Core/BSP/Pine64/Power.cpp index 2dfa76a0..42bee942 100644 --- a/source/Core/BSP/Pine64/Power.cpp +++ b/source/Core/BSP/Pine64/Power.cpp @@ -16,7 +16,7 @@ void power_check() { if (FUSB302_present) { PolicyEngine::PPSTimerCallback(); // Cant start QC until either PD works or fails - if (PolicyEngine::setupCompleteOrTimedOut() == false) { + if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) { return; } if (PolicyEngine::pdHasNegotiated()) { @@ -43,7 +43,7 @@ uint8_t usb_pd_detect() { bool getIsPoweredByDCIN() { // We return false until we are sure we are not using PD - if (PolicyEngine::setupCompleteOrTimedOut() == false) { + if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) { return false; } if (PolicyEngine::pdHasNegotiated()) { diff --git a/source/Core/Drivers/FUSB302/policy_engine.cpp b/source/Core/Drivers/FUSB302/policy_engine.cpp index 8d76a63f..989913cc 100644 --- a/source/Core/Drivers/FUSB302/policy_engine.cpp +++ b/source/Core/Drivers/FUSB302/policy_engine.cpp @@ -21,6 +21,7 @@ #include "int_n.h" #include #include + bool PolicyEngine::pdNegotiationComplete; int PolicyEngine::current_voltage_mv; int PolicyEngine::_requested_voltage; @@ -617,6 +618,19 @@ void PolicyEngine::PPSTimerCallback() { } } +bool PolicyEngine::NegotiationTimeoutReached(uint8_t timeout) { + if (timeout == 0) { + return false; + } + + if (xTaskGetTickCount() > (TICKS_100MS * timeout)) { + state = PESinkSourceUnresponsive; + return true; + } + + return false; +} + EventBits_t PolicyEngine::pushMessage(union pd_msg *msg) { if (PD_MSGTYPE_GET(msg) == PD_MSGTYPE_SOFT_RESET && PD_NUMOBJ_GET(msg) == 0) { /* Clear MessageIDCounter */ diff --git a/source/Core/Drivers/FUSB302/policy_engine.h b/source/Core/Drivers/FUSB302/policy_engine.h index 6ad27716..8cd89611 100644 --- a/source/Core/Drivers/FUSB302/policy_engine.h +++ b/source/Core/Drivers/FUSB302/policy_engine.h @@ -33,9 +33,11 @@ public: static void handleMessage(union pd_msg *msg); // Returns true if headers indicate PD3.0 compliant static bool isPD3_0(); - static bool setupCompleteOrTimedOut() { + static bool setupCompleteOrTimedOut(uint8_t timeout) { if (pdNegotiationComplete) return true; + if (PolicyEngine::NegotiationTimeoutReached(timeout)) + return true; if (state == policy_engine_state::PESinkSourceUnresponsive) return true; if (state == policy_engine_state::PESinkReady) @@ -51,6 +53,8 @@ public: // Call this periodically, at least once every second static void PPSTimerCallback(); + static bool NegotiationTimeoutReached(uint8_t timeout); + enum class Notifications { PDB_EVT_PE_RESET = EVENT_MASK(0), PDB_EVT_PE_MSG_RX = EVENT_MASK(1), diff --git a/source/Core/Inc/Settings.h b/source/Core/Inc/Settings.h index 45e3bb20..7dc94474 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -61,6 +61,8 @@ typedef struct { uint8_t pdMissingWarningCounter; // Counter of how many times we have warned we cannot detect the pd interface char uiLanguage[8]; // Selected UI Language code, null-terminated *only if* the length is less than 8 chars + uint8_t PDNegTimeout; // PD timeout in 100ms steps + uint32_t padding; // This is here for in case we are not an even divisor so // that nothing gets cut off // MUST BE LAST diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 1e9c7635..6362c83c 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -45,6 +45,7 @@ enum class SettingsItemIndex : uint8_t { AdvancedSoldering, ScrollingSpeed, QCMaxVoltage, + PDNegTimeout, PowerLimit, ReverseButtonTempChange, TempChangeShortStep, diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 358323f3..db014f90 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -57,6 +57,7 @@ void resetSettings() { systemSettings.minDCVoltageCells = CUT_OUT_SETTING; // default to no cut-off voltage systemSettings.minVoltageCells = RECOM_VOL_CELL; // Minimum voltage per cell (Recommended 3.3V (33)) systemSettings.QCIdealVoltage = 0; // Default to 9V for QC3.0 Voltage + systemSettings.PDNegTimeout = 0; // Default for PD timout to 0 systemSettings.version = SETTINGSVERSION; // Store the version number to allow for easier upgrades systemSettings.detailedSoldering = DETAILED_SOLDERING; // Detailed soldering screen systemSettings.detailedIDLE = DETAILED_IDLE; // Detailed idle screen (off for first time users) diff --git a/source/Core/Src/gui.cpp b/source/Core/Src/gui.cpp index 50cf0f03..9e9a518f 100644 --- a/source/Core/Src/gui.cpp +++ b/source/Core/Src/gui.cpp @@ -26,7 +26,10 @@ static bool settings_displayInputMinVRange(void); static bool settings_setQCInputV(void); static bool settings_displayQCInputV(void); #endif - +#ifdef POW_PD +static bool settings_setPDNegTimeout(void); +static bool settings_displayPDNegTimeout(void); +#endif #ifndef NO_SLEEP_MODE static bool settings_setSleepTemp(void); static bool settings_displaySleepTemp(void); @@ -162,7 +165,7 @@ const menuitem rootSettingsMenu[] { } // end of menu marker. DO NOT REMOVE }; -#if defined(POW_DC) || defined(POW_QC) +#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) const menuitem powerMenu[] = { /* * Power Source @@ -173,6 +176,9 @@ const menuitem powerMenu[] = { #endif #ifdef POW_QC {SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/ +#endif +#ifdef POW_PD + {SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), settings_setPDNegTimeout, settings_displayPDNegTimeout}, /*PD timeout setup*/ #endif {0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE }; @@ -350,6 +356,7 @@ static bool settings_displayInputMinVRange(void) { static bool settings_setQCInputV(void) { #ifdef POW_QC_20V systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 3; + return systemSettings.QCIdealVoltage == 2; #else systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 2; @@ -382,6 +389,21 @@ static bool settings_displayQCInputV(void) { #endif +#ifdef POW_PD +static bool settings_setPDNegTimeout(void) { + systemSettings.PDNegTimeout = (systemSettings.PDNegTimeout + 1) % 50; + + return systemSettings.PDNegTimeout == 49; +} + +static bool settings_displayPDNegTimeout(void) { + printShortDescription(SettingsItemIndex::PDNegTimeout, 5); + OLED::printNumber(systemSettings.PDNegTimeout, 2, FontStyle::LARGE); + + return systemSettings.PDNegTimeout == 49; +} +#endif + #ifndef NO_SLEEP_MODE static bool settings_setSleepTemp(void) { // If in C, 10 deg, if in F 20 deg