From 81de60e1e46cd9f919059b0f390546d5548e8a79 Mon Sep 17 00:00:00 2001 From: Varga Zsolt Date: Sun, 6 Jun 2021 18:45:00 +0200 Subject: [PATCH] USB PD timeout added --- Translations/translation_BG.json | 7 +++++++ Translations/translation_CS.json | 7 +++++++ Translations/translation_DA.json | 7 +++++++ Translations/translation_DE.json | 7 +++++++ Translations/translation_EN.json | 7 +++++++ Translations/translation_ES.json | 7 +++++++ Translations/translation_FI.json | 7 +++++++ Translations/translation_FR.json | 7 +++++++ Translations/translation_HR.json | 7 +++++++ Translations/translation_HU.json | 7 +++++++ Translations/translation_IT.json | 7 +++++++ Translations/translation_JA_JP.json | 7 +++++++ Translations/translation_LT.json | 7 +++++++ Translations/translation_NL.json | 7 +++++++ Translations/translation_NL_BE.json | 7 +++++++ Translations/translation_NO.json | 7 +++++++ Translations/translation_PL.json | 7 +++++++ Translations/translation_PT.json | 7 +++++++ Translations/translation_RU.json | 7 +++++++ Translations/translation_SK.json | 7 +++++++ Translations/translation_SL.json | 7 +++++++ Translations/translation_SR_CYRL.json | 7 +++++++ Translations/translation_SR_LATN.json | 7 +++++++ Translations/translation_SV.json | 7 +++++++ Translations/translation_TR.json | 7 +++++++ Translations/translation_UK.json | 7 +++++++ Translations/translation_YUE_HK.json | 7 +++++++ Translations/translation_ZH_CN.json | 7 +++++++ Translations/translation_ZH_TW.json | 7 +++++++ Translations/translations_def.js | 6 ++++++ source/Core/Drivers/FUSB302/policy_engine.cpp | 14 ++++++++++++++ source/Core/Drivers/FUSB302/policy_engine.h | 8 ++++++++ source/Core/Inc/Settings.h | 1 + source/Core/Inc/Translation.h | 1 + source/Core/Src/Settings.cpp | 1 + source/Core/Src/gui.cpp | 18 ++++++++++++++++++ 36 files changed, 252 insertions(+) diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index 337ea374..230dc44d 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.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": [ "Лимит на", diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index 9964c606..cee4e94d 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -222,6 +222,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 63560530..dc4ed073 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -222,6 +222,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 9fa6d1c2..91a012a0 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -223,6 +223,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 8e22848f..51f7e8a1 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -222,6 +222,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 801164a9..75c5268c 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -223,6 +223,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 86cbd721..4a64a92a 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -221,6 +221,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 bc49e8e1..9a19f1b0 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -222,6 +222,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 8d57938d..e697c05f 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -222,6 +222,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 2ee4fa77..152345a9 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -225,6 +225,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 ee13efe1..03e335f2 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -222,6 +222,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 9a34b60e..43346306 100644 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -154,6 +154,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 ee8f9346..08ade638 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -222,6 +222,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 8bdd20fe..9ec43f05 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -222,6 +222,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 20e46163..f835bb55 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -222,6 +222,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 43c390f1..36a0029f 100644 --- a/Translations/translation_NO.json +++ b/Translations/translation_NO.json @@ -222,6 +222,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 f5fc3bb8..f079404d 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -223,6 +223,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 65729ca6..d494f4ba 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -222,6 +222,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 55a84446..4493031b 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.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": [ "Предел", diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index 6e943d2b..fd5fa433 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -222,6 +222,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 beb803bd..30f57661 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -222,6 +222,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 64d76e15..4f15c1bc 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -222,6 +222,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 97e9a7c3..204c1c48 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -222,6 +222,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 65afc2cb..5f4ff096 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -216,6 +216,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 bd194f5a..3da91e6a 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -232,6 +232,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 5c76f57b..aa613683 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.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": [ "Макс.", diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index b6c6454c..51215151 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -154,6 +154,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 ca2370fd..1af6fe72 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -154,6 +154,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 46082a59..6cb02207 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -154,6 +154,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 6d0f206e..7baa271d 100644 --- a/Translations/translations_def.js +++ b/Translations/translations_def.js @@ -280,6 +280,12 @@ var def = "maxLen": 8, "maxLen2": 16 }, + { + "id": "PDNegTimeout", + "maxLen": 8, + "maxLen2": 16 + }, + { "id": "PowerLimit", "maxLen": 5, diff --git a/source/Core/Drivers/FUSB302/policy_engine.cpp b/source/Core/Drivers/FUSB302/policy_engine.cpp index 8d76a63f..8a2a29bd 100644 --- a/source/Core/Drivers/FUSB302/policy_engine.cpp +++ b/source/Core/Drivers/FUSB302/policy_engine.cpp @@ -21,6 +21,8 @@ #include "int_n.h" #include #include +#include "Settings.h" + bool PolicyEngine::pdNegotiationComplete; int PolicyEngine::current_voltage_mv; int PolicyEngine::_requested_voltage; @@ -617,6 +619,18 @@ void PolicyEngine::PPSTimerCallback() { } } +bool PolicyEngine::NegotiationTimeoutReached() { + if (systemSettings.PDNegTimeout == 0){ + return false; + } + + if (xTaskGetTickCount() > (TICKS_SECOND/10 * systemSettings.PDNegTimeout)) { + 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..96bd12a5 100644 --- a/source/Core/Drivers/FUSB302/policy_engine.h +++ b/source/Core/Drivers/FUSB302/policy_engine.h @@ -36,6 +36,8 @@ public: static bool setupCompleteOrTimedOut() { if (pdNegotiationComplete) return true; + if (PolicyEngine::NegotiationTimeoutReached()) + return true; if (state == policy_engine_state::PESinkSourceUnresponsive) return true; if (state == policy_engine_state::PESinkReady) @@ -46,11 +48,17 @@ public: static bool pdHasNegotiated() { if (state == policy_engine_state::PESinkSourceUnresponsive) return false; + if (pdNegotiationComplete) + return true; + if (PolicyEngine::NegotiationTimeoutReached()) + return false; return true; } // Call this periodically, at least once every second static void PPSTimerCallback(); + static bool NegotiationTimeoutReached(); + 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..f04c026c 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -27,6 +27,7 @@ typedef struct { uint8_t minDCVoltageCells; // The voltage we cut out at for under voltage when powered by DC jack uint8_t minVoltageCells; // Minimum allowed voltage per cell <3S - 3.0V (30)> <4S - 2.4V (24)> <...> (Minimum recommended 2.7V) uint8_t QCIdealVoltage; // Desired QC3.0 voltage (9,12,20V) + uint8_t PDNegTimeout; // PD timeout in 100ms steps uint8_t OrientationMode : 2; // Selects between Auto,Right and left handed layouts uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits) uint8_t animationLoop : 1; // Animation loop switch diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 84e88844..5bb54963 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..ac15b83b 100644 --- a/source/Core/Src/gui.cpp +++ b/source/Core/Src/gui.cpp @@ -27,6 +27,9 @@ static bool settings_setQCInputV(void); static bool settings_displayQCInputV(void); #endif +static bool settings_setPDNegTimeout(void); +static bool settings_displayPDNegTimeout(void); + #ifndef NO_SLEEP_MODE static bool settings_setSleepTemp(void); static bool settings_displaySleepTemp(void); @@ -174,6 +177,7 @@ const menuitem powerMenu[] = { #ifdef POW_QC {SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/ #endif + {SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), settings_setPDNegTimeout, settings_displayPDNegTimeout}, /*PD timeout setup*/ {0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE }; #endif @@ -350,6 +354,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 +387,19 @@ static bool settings_displayQCInputV(void) { #endif +static bool settings_setPDNegTimeout(void) { + systemSettings.PDNegTimeout = (systemSettings.PDNegTimeout + 1) % 50; + + return systemSettings.QCIdealVoltage == 49; +} + +static bool settings_displayPDNegTimeout(void){ + printShortDescription(SettingsItemIndex::PDNegTimeout, 5); + OLED::printNumber(systemSettings.PDNegTimeout, 2, FontStyle::LARGE); + + return systemSettings.QCIdealVoltage == 49; +} + #ifndef NO_SLEEP_MODE static bool settings_setSleepTemp(void) { // If in C, 10 deg, if in F 20 deg