mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
USB PD timeout added
This commit is contained in:
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Мощност на избраното захранване"
|
"desc": "Мощност на избраното захранване"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Лимит на",
|
"Лимит на",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Výkon použítého napájecího adaptéru ve wattech."
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Omezení",
|
"Omezení",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Power Wattage of the power adapter used"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Maximal zulässige Spannung der verwendeten Spannungsversorgung (V=Volt)"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Leistungs-",
|
"Leistungs-",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Max QC voltage the iron should negotiate for"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Potencia en vatios del adaptador de corriente utilizado."
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Ajustar la",
|
"Ajustar la",
|
||||||
|
|||||||
@@ -221,6 +221,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Ensisijainen maksimi QC jännite"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Tehon-",
|
"Tehon-",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Tension maximale désirée avec une alimentation QC"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Limite de",
|
"Limite de",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Snaga modula za napajanje"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -225,6 +225,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Maximális USB feszültség (QuickCharge)"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Teljesítmény",
|
"Teljesítmény",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Imposta il massimo voltaggio negoziabile con un alimentatore Quick Charge"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Limite",
|
"Limite",
|
||||||
|
|||||||
@@ -154,6 +154,13 @@
|
|||||||
"text2": "QC電圧",
|
"text2": "QC電圧",
|
||||||
"desc": "QC電源使用時に要求する目標電圧"
|
"desc": "QC電源使用時に要求する目標電圧"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": "電力制限",
|
"text2": "電力制限",
|
||||||
"desc": "はんだ付てが使用できる最大電力を制限する <W=ワット>"
|
"desc": "はんだ付てが使用できる最大電力を制限する <W=ワット>"
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Maksimali QC maitinimo bloko įtampa"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Galios",
|
"Galios",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Wattage van de gebruikte voeding"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Vermogen",
|
"Vermogen",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Vermogen van de adapter"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Power Wattage of the power adapter used"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Moc używanego zasilacza w (W)"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Ogr.",
|
"Ogr.",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Potência da fonte usada (Watt)"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Мощность используемого источника питания"
|
"desc": "Мощность используемого источника питания"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Предел",
|
"Предел",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Obmedzenie výkonu podľa použitého zdroja"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Obmedzenie",
|
"Obmedzenie",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Moč napajalnega vira v vatih [W]"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Meja",
|
"Meja",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Снага напајања у ватима."
|
"desc": "Снага напајања у ватима."
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -222,6 +222,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Snaga napajanja u vatima."
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Power",
|
||||||
|
|||||||
@@ -216,6 +216,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Maximal QC-spänning enheten skall efterfråga"
|
"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": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Max-",
|
"Max-",
|
||||||
|
|||||||
@@ -232,6 +232,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Desired max QC Voltage negotiated for"
|
"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": {
|
"PowerInput": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Güç",
|
"Güç",
|
||||||
|
|||||||
@@ -223,6 +223,13 @@
|
|||||||
],
|
],
|
||||||
"desc": "Потужність джерела живлення в Ватах"
|
"desc": "Потужність джерела живлення в Ватах"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Макс.",
|
"Макс.",
|
||||||
|
|||||||
@@ -154,6 +154,13 @@
|
|||||||
"text2": "QC電壓",
|
"text2": "QC電壓",
|
||||||
"desc": "使用QC電源時請求嘅最高目標電壓"
|
"desc": "使用QC電源時請求嘅最高目標電壓"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": "功率限制",
|
"text2": "功率限制",
|
||||||
"desc": "限制辣雞可用嘅最大功率 <W=watt(火)>"
|
"desc": "限制辣雞可用嘅最大功率 <W=watt(火)>"
|
||||||
|
|||||||
@@ -154,6 +154,13 @@
|
|||||||
"text2": "QC电压",
|
"text2": "QC电压",
|
||||||
"desc": "使用QC电源时请求的最高目标电压"
|
"desc": "使用QC电源时请求的最高目标电压"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": "功率限制",
|
"text2": "功率限制",
|
||||||
"desc": "限制铬铁可用的最大功率 <W=watt(瓦特)>"
|
"desc": "限制铬铁可用的最大功率 <W=watt(瓦特)>"
|
||||||
|
|||||||
@@ -154,6 +154,13 @@
|
|||||||
"text2": "QC電壓",
|
"text2": "QC電壓",
|
||||||
"desc": "使用QC電源時請求的最高目標電壓"
|
"desc": "使用QC電源時請求的最高目標電壓"
|
||||||
},
|
},
|
||||||
|
"PDNegTimeout": {
|
||||||
|
"text2": [
|
||||||
|
"PD",
|
||||||
|
"timeout"
|
||||||
|
],
|
||||||
|
"desc": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers (0: disabled)"
|
||||||
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": "功率限制",
|
"text2": "功率限制",
|
||||||
"desc": "限制鉻鐵可用的最大功率 <W=watt(瓦特)>"
|
"desc": "限制鉻鐵可用的最大功率 <W=watt(瓦特)>"
|
||||||
|
|||||||
@@ -280,6 +280,12 @@ var def =
|
|||||||
"maxLen": 8,
|
"maxLen": 8,
|
||||||
"maxLen2": 16
|
"maxLen2": 16
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "PDNegTimeout",
|
||||||
|
"maxLen": 8,
|
||||||
|
"maxLen2": 16
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": "PowerLimit",
|
"id": "PowerLimit",
|
||||||
"maxLen": 5,
|
"maxLen": 5,
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "int_n.h"
|
#include "int_n.h"
|
||||||
#include <pd.h>
|
#include <pd.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
bool PolicyEngine::pdNegotiationComplete;
|
bool PolicyEngine::pdNegotiationComplete;
|
||||||
int PolicyEngine::current_voltage_mv;
|
int PolicyEngine::current_voltage_mv;
|
||||||
int PolicyEngine::_requested_voltage;
|
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) {
|
EventBits_t PolicyEngine::pushMessage(union pd_msg *msg) {
|
||||||
if (PD_MSGTYPE_GET(msg) == PD_MSGTYPE_SOFT_RESET && PD_NUMOBJ_GET(msg) == 0) {
|
if (PD_MSGTYPE_GET(msg) == PD_MSGTYPE_SOFT_RESET && PD_NUMOBJ_GET(msg) == 0) {
|
||||||
/* Clear MessageIDCounter */
|
/* Clear MessageIDCounter */
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public:
|
|||||||
static bool setupCompleteOrTimedOut() {
|
static bool setupCompleteOrTimedOut() {
|
||||||
if (pdNegotiationComplete)
|
if (pdNegotiationComplete)
|
||||||
return true;
|
return true;
|
||||||
|
if (PolicyEngine::NegotiationTimeoutReached())
|
||||||
|
return true;
|
||||||
if (state == policy_engine_state::PESinkSourceUnresponsive)
|
if (state == policy_engine_state::PESinkSourceUnresponsive)
|
||||||
return true;
|
return true;
|
||||||
if (state == policy_engine_state::PESinkReady)
|
if (state == policy_engine_state::PESinkReady)
|
||||||
@@ -46,11 +48,17 @@ public:
|
|||||||
static bool pdHasNegotiated() {
|
static bool pdHasNegotiated() {
|
||||||
if (state == policy_engine_state::PESinkSourceUnresponsive)
|
if (state == policy_engine_state::PESinkSourceUnresponsive)
|
||||||
return false;
|
return false;
|
||||||
|
if (pdNegotiationComplete)
|
||||||
|
return true;
|
||||||
|
if (PolicyEngine::NegotiationTimeoutReached())
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Call this periodically, at least once every second
|
// Call this periodically, at least once every second
|
||||||
static void PPSTimerCallback();
|
static void PPSTimerCallback();
|
||||||
|
|
||||||
|
static bool NegotiationTimeoutReached();
|
||||||
|
|
||||||
enum class Notifications {
|
enum class Notifications {
|
||||||
PDB_EVT_PE_RESET = EVENT_MASK(0),
|
PDB_EVT_PE_RESET = EVENT_MASK(0),
|
||||||
PDB_EVT_PE_MSG_RX = EVENT_MASK(1),
|
PDB_EVT_PE_MSG_RX = EVENT_MASK(1),
|
||||||
|
|||||||
@@ -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 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 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 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 OrientationMode : 2; // Selects between Auto,Right and left handed layouts
|
||||||
uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits)
|
uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits)
|
||||||
uint8_t animationLoop : 1; // Animation loop switch
|
uint8_t animationLoop : 1; // Animation loop switch
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ enum class SettingsItemIndex : uint8_t {
|
|||||||
AdvancedSoldering,
|
AdvancedSoldering,
|
||||||
ScrollingSpeed,
|
ScrollingSpeed,
|
||||||
QCMaxVoltage,
|
QCMaxVoltage,
|
||||||
|
PDNegTimeout,
|
||||||
PowerLimit,
|
PowerLimit,
|
||||||
ReverseButtonTempChange,
|
ReverseButtonTempChange,
|
||||||
TempChangeShortStep,
|
TempChangeShortStep,
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ void resetSettings() {
|
|||||||
systemSettings.minDCVoltageCells = CUT_OUT_SETTING; // default to no cut-off voltage
|
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.minVoltageCells = RECOM_VOL_CELL; // Minimum voltage per cell (Recommended 3.3V (33))
|
||||||
systemSettings.QCIdealVoltage = 0; // Default to 9V for QC3.0 Voltage
|
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.version = SETTINGSVERSION; // Store the version number to allow for easier upgrades
|
||||||
systemSettings.detailedSoldering = DETAILED_SOLDERING; // Detailed soldering screen
|
systemSettings.detailedSoldering = DETAILED_SOLDERING; // Detailed soldering screen
|
||||||
systemSettings.detailedIDLE = DETAILED_IDLE; // Detailed idle screen (off for first time users)
|
systemSettings.detailedIDLE = DETAILED_IDLE; // Detailed idle screen (off for first time users)
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ static bool settings_setQCInputV(void);
|
|||||||
static bool settings_displayQCInputV(void);
|
static bool settings_displayQCInputV(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool settings_setPDNegTimeout(void);
|
||||||
|
static bool settings_displayPDNegTimeout(void);
|
||||||
|
|
||||||
#ifndef NO_SLEEP_MODE
|
#ifndef NO_SLEEP_MODE
|
||||||
static bool settings_setSleepTemp(void);
|
static bool settings_setSleepTemp(void);
|
||||||
static bool settings_displaySleepTemp(void);
|
static bool settings_displaySleepTemp(void);
|
||||||
@@ -174,6 +177,7 @@ const menuitem powerMenu[] = {
|
|||||||
#ifdef POW_QC
|
#ifdef POW_QC
|
||||||
{SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/
|
{SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/
|
||||||
#endif
|
#endif
|
||||||
|
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), settings_setPDNegTimeout, settings_displayPDNegTimeout}, /*PD timeout setup*/
|
||||||
{0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE
|
{0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@@ -350,6 +354,7 @@ static bool settings_displayInputMinVRange(void) {
|
|||||||
static bool settings_setQCInputV(void) {
|
static bool settings_setQCInputV(void) {
|
||||||
#ifdef POW_QC_20V
|
#ifdef POW_QC_20V
|
||||||
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 3;
|
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 3;
|
||||||
|
|
||||||
return systemSettings.QCIdealVoltage == 2;
|
return systemSettings.QCIdealVoltage == 2;
|
||||||
#else
|
#else
|
||||||
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 2;
|
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 2;
|
||||||
@@ -382,6 +387,19 @@ static bool settings_displayQCInputV(void) {
|
|||||||
|
|
||||||
#endif
|
#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
|
#ifndef NO_SLEEP_MODE
|
||||||
static bool settings_setSleepTemp(void) {
|
static bool settings_setSleepTemp(void) {
|
||||||
// If in C, 10 deg, if in F 20 deg
|
// If in C, 10 deg, if in F 20 deg
|
||||||
|
|||||||
Reference in New Issue
Block a user