Expand USB-PD mode option (#1917)
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 (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 / upload_metadata (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

* Use PDMode to decide if we do resistance pad

* Rename PDVpdo to USBPDMode

* Add options for PD Mode

* OLED: Allow soft line-wrap x position

* Add new translation option for menu settings values

* Use new setting value for PD Mode

* Update translations for new menu setting

* Fixup! S60

* black python
This commit is contained in:
Ben V. Brown
2024-06-01 16:36:34 +10:00
committed by GitHub
parent c135732ebb
commit 442dbd982e
47 changed files with 11370 additions and 10967 deletions

View File

@@ -76,13 +76,13 @@ def filter_translation(lang: dict, defs: dict, macros: frozenset):
return False
for category in ("menuOptions", "menuGroups"):
for index, record in enumerate(defs[category]):
for category in ("menuOptions", "menuGroups", "menuValues"):
for _, record in enumerate(defs[category]):
if check_excluded(record):
lang[category][record["id"]]["displayText"] = ""
lang[category][record["id"]]["description"] = ""
for index, record in enumerate(defs["messagesWarn"]):
for _, record in enumerate(defs["messagesWarn"]):
if check_excluded(record):
lang["messagesWarn"][record["id"]]["message"] = ""
@@ -249,6 +249,15 @@ def get_letter_counts(defs: dict, lang: dict, build_version: str) -> Dict:
msg = obj[eid]["description"]
big_font_messages.append(msg)
obj = lang["menuValues"]
for mod in defs["menuValues"]:
eid = mod["id"]
msg = obj[eid]["displayText"]
if test_is_small_font(msg):
small_font_messages.append(msg)
else:
big_font_messages.append(msg)
obj = lang["menuGroups"]
for mod in defs["menuGroups"]:
eid = mod["id"]
@@ -1114,6 +1123,12 @@ def get_translation_strings_and_indices_text(
encode_string_and_add(
lang_data["displayText"], "menuOptions" + record["id"] + "displayText"
)
for index, record in enumerate(defs["menuValues"]):
lang_data = lang["menuValues"][record["id"]]
# Add to translations the menu text and the description
encode_string_and_add(
lang_data["displayText"], "menuValues" + record["id"] + "displayText"
)
for index, record in enumerate(defs["menuGroups"]):
lang_data = lang["menuGroups"][record["id"]]
@@ -1201,6 +1216,21 @@ def get_translation_strings_and_indices_text(
f" .{record['id']} = {start_index}, // {escape(lang_data)}\n"
)
for _, record in enumerate(defs["menuValues"]):
# Add to translations the menu text and the description
lang_data = lang["menuValues"][record["id"]]
key = "menuValues" + record["id"] + "displayText"
translated_index = translated_string_lookups[key]
string_index = translated_index.byte_encoded_translation_index
start_index = (
string_index_commulative_lengths[string_index]
+ translated_index.str_start_offset
)
translation_indices_text += (
f" .{record['id']} = {start_index}, // {escape(lang_data)}\n"
)
translation_indices_text += "\n"
# Now for the fun ones, where they are nested and ordered
@@ -1230,6 +1260,7 @@ def get_translation_strings_and_indices_text(
translation_indices_text = write_grouped_indexes(
translation_indices_text, "SettingsShortNames", "menuOptions", "displayText"
)
translation_indices_text = write_grouped_indexes(
translation_indices_text,
"SettingsMenuEntriesDescriptions",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Крыніца\nсілкавання",
@@ -122,8 +133,8 @@
"displayText": "PD\nпрыпынак",
"description": "Час чакання ўзгаднення PD з крокам 100 мс для сумяшчальнасці з некаторымі зараднымі зараднымі прыладамі QC (0: адключана)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Уключае рэжымы PPS & EPR."
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Гранично\nнапрежение",
@@ -122,8 +133,8 @@
"displayText": "PD\nинтервал",
"description": "PD интервал за договаряне на захранването на стъпки от 100 мс за съвместимост с някои QC захранвания (0=Изкл.)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Включи PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Zdroj\nnapájení",
@@ -122,8 +133,8 @@
"displayText": "PD\ntimeout",
"description": "Maximální prodleva při jednání PD ve 100ms krocích pro kompatibilitu s některými QC nabíječkami"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Povoluje režimy PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Strøm\nKilde",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD-forhandlingstimeout i trin på 100 ms for kompatibilitet med nogle QC-opladere"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Boost\ntemp",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Spannungs-\nquelle",
@@ -122,8 +133,8 @@
"displayText": "PD\ntimeout",
"description": "PD Abfragedauer in 100ms Schritten (Kompatibilität mit best. QC-Ladegeräten)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Aktiviert PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Πηγή\nενέργειας",
@@ -122,8 +133,8 @@
"displayText": "χρονικό όριο\nPD",
"description": "Χρονικό όριο διαπραγμάτευσης PD σε βήματα 100ms για συμβατότητα με κάποιους φορτιστές QC"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Ενεργοποιεί λειτουργίες PPS & EPR."
},
"BoostTemperature": {

View File

@@ -105,10 +105,21 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Power\nsource",
"description": "Set cutoff voltage to prevent battery overdrainage (DC 10V) (S=3.3V per cell, disable PWR limit)"
"description": "Set cutoff voltage to prevent battery overdischarge (DC=10V) (S=3.3V per cell, disable PWR limit)"
},
"MinVolCell": {
"displayText": "Minimum\nvoltage",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Boost\ntemp",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Fuente\nde energía",
@@ -121,10 +132,9 @@
"PDNegTimeout": {
"displayText": "PD\ntiempo de espera",
"description": "Timeout de negociación de PD en pasos de 100ms para compatibilidad con algunos cargadores QC (0: apagado)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Permite modos PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Toiteallikas\nDC",
@@ -122,8 +133,8 @@
"displayText": "PD\naegumine",
"description": "PD läbirääkimise aegumine 100ms sammudena, et tagada ühilduvus osade QC laadijatega"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Võimaldab PPS- ja EPR-režiimi"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Virtalähde\nDC",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Tehostus-\nlämpötila",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Source\nd'alim.",
@@ -122,9 +133,9 @@
"displayText": "Délai\nexpir. PD",
"description": "Délai de la negociation PD par étapes de 100ms pour la compatiblité avec certains chargeurs QC"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Temp.\nboost",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Izvor\nnapajanja",
@@ -122,9 +133,9 @@
"displayText": "USB-PD\ntimeout",
"description": "Timeout za USB-Power Delivery u koracima od 100ms za kompatibilnost s nekim QC punjačima"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Boost\ntemp",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Áram\nforrás",
@@ -122,9 +133,9 @@
"displayText": "PD\nidőtúllépés",
"description": "PD egyeztetés időkerete (kompatibilitás QC töltőkkel) (x 100ms)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Boost\nhőmérséklet",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Sorgente\nalimentaz",
@@ -122,8 +133,8 @@
"displayText": "Abilitazione\nUSB PD",
"description": "Regola il massimo tempo utile per la negoziazione del protocollo USB Power Delivery con alimentatori compatibili [0: disattiva; multipli di 100 ms]"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Abilita le modalità Power Delivery PPS ed EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "下限電圧",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "一部のQC電源との互換性のため、PDネゴシエーションをタイムアウトする時間 <x100msミリ秒>"
},
"PDVpdo": {
"USBPDMode": {
"displayText": "PD VPDO",
"description": "Enables PPS & EPR modes"
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "ブースト温度",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Maitinimo\nšaltinis",
@@ -122,9 +133,9 @@
"displayText": "PD\nlaikas",
"description": "PD suderinimo laikas žingsniais po 100ms suderinamumui su kai kuriais QC įkrovikliais"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Turbo\ntemperat.",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Kilde\n",
@@ -122,9 +133,9 @@
"displayText": "PD-\ntidsavb.",
"description": "PD-forhandlingstidsavbrudd i steg på 100 ms for kompatibilitet med noen QC-ladere"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "KTmp\n",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Vermogens\nbron",
@@ -122,8 +133,8 @@
"displayText": "PD ver-\nloop tijd",
"description": "PD onderhandelings verlooptijd, afstemmingsduur in stappen van 100 ms (voor compatibiliteit met sommige QC laders)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Zet PPS & EPR modes aan"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Spannings-\nbron",
@@ -122,8 +133,8 @@
"displayText": "PD\ntimeout",
"description": "PD afstemmingsduur in stappen van 100ms (voor compatibiliteit met sommige QC laders)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Zet PPS & EPR modes aan"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Źródło\nzasilania",
@@ -122,8 +133,8 @@
"displayText": "Limit czasu\nPD",
"description": "Limit czasu negocjacji PD w krokach co 100 ms dla zgodności z niektórymi ładowarkami QC (0: wyłączone)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Włącza tryby PPS & EPR."
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Fonte\nalimentação",
@@ -122,8 +133,8 @@
"displayText": "PD tempo\nlimite",
"description": "Tempo limite de negoiciação de PD de 100ms para compatibilidade com alguns carregadores é (0: disabled)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Activa o modo PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Sursa de\nalimentare",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "Timp limită de negociere pentru tranzacţia PD, în paşi de 100ms, pentru compatibilitate cu alimentatoarele QC"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Modifică\ntemp. impuls",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Предельное\nнапряжение",
@@ -122,8 +133,8 @@
"displayText": "PD\nинтервал",
"description": "Интервал согласования питания по Power Delivery с шагом 100 мс для совместимости с некоторыми источниками питания по QC (0=Откл.)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Включить режимы PPS & EPR"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Zdroj\nnapätia",
@@ -122,8 +133,8 @@
"displayText": "Čas vypršania\nPower Delivery",
"description": "Čas vyjednávania Power Delivery v 100ms krokoch pre kompatibilitu s niektorými QC nabíjačkami (0: vypnuté)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Zapína PPS & EPR režimy"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Vir\nnapajanja",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Pospešena\ntemp.",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Врста\nнапајања",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Темп.\nпојачања",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Vrsta\nnapajanja",
@@ -122,9 +133,9 @@
"displayText": "PD\ntimeout",
"description": "PD negotiation timeout in 100ms steps for compatibility with some QC chargers"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Temp.\npojačanja",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Ström-\nkälla",
@@ -122,8 +133,8 @@
"displayText": "PD\npauser",
"description": "PD förhandlings pauser i 100ms steg för kompatibilitet med vissa PD laddare"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Slår på PPS & EPR lägen"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "GÇKYN\n",
@@ -122,8 +133,8 @@
"displayText": "PD\nTimeout",
"description": "Bazı QC şarj cihazlarıyla uyumluluk için 100ms adımlarında PD pazarlık zaman aşımı"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "PPS & EPR modlarını etkinleştirir"
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Джерело\nживлення",
@@ -122,8 +133,8 @@
"displayText": "PD\nзатримка",
"description": "Затримка у 100мс інкрементах для PD для сумісності з деякими QC зарядними пристроями (0: вимкнено)"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"USBPDMode": {
"displayText": "PD\nMode",
"description": "Вмикає режими PPS & EPR."
},
"BoostTemperature": {

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "Nguon\nđien",
@@ -122,9 +133,9 @@
"displayText": "PD\nsau",
"description": "Thoi gian cho đàm phán PD trong các buoc 100ms đe tuong thích voi mot so bo sac QC"
},
"PDVpdo": {
"displayText": "PD\nVPDO",
"description": "Enables PPS & EPR modes"
"USBPDMode": {
"displayText": "PD\nMode",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "Tăng\nnhiet đo",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "電源",
@@ -122,9 +133,9 @@
"displayText": "PD逾時",
"description": "設定USB PD協定交涉嘅逾時時限為兼容某啲QC電源而設 <x100ms亳秒>"
},
"PDVpdo": {
"USBPDMode": {
"displayText": "PD VPDO",
"description": "Enables PPS & EPR modes"
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
"BoostTemperature": {
"displayText": "增熱温度",

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "下限电压",
@@ -122,7 +133,7 @@
"displayText": "PD超时",
"description": "设定USB-PD协议交涉的超时时限为兼容某些QC电源而设 <x100ms亳秒>"
},
"PDVpdo": {
"USBPDMode": {
"displayText": "PD VPDO",
"description": "启用PPS和EPR快充支持"
},

View File

@@ -105,6 +105,17 @@
"description": ""
}
},
"menuValues": {
"USBPDModeDefault": {
"displayText": "Default\nMode"
},
"USBPDModeNoDynamic": {
"displayText": "No\nDynamic"
},
"USBPDModeSafe": {
"displayText": "Safe\nMode"
}
},
"menuOptions": {
"DCInCutoff": {
"displayText": "電源",
@@ -122,7 +133,7 @@
"displayText": "PD逾時",
"description": "設定USB PD協定交涉的逾時時限為兼容某些QC電源而設 <x100ms亳秒>"
},
"PDVpdo": {
"USBPDMode": {
"displayText": "PD VPDO",
"description": "開啟PPS及EPR支援"
},

View File

@@ -1,5 +1,6 @@
{
"messagesWarn": [{
"messagesWarn": [
{
"id": "CalibrationDone",
"description": "Confirmation message indicating calibration is complete."
},
@@ -17,9 +18,7 @@
},
{
"id": "NoPowerDeliveryMessage",
"include": [
"POW_PD"
],
"include": ["POW_PD"],
"description": "The IC required for USB-PD could not be communicated with. This is an error warning that USB-PD WILL NOT FUNCTION. Generally indicative of either a hardware or software issues."
},
{
@@ -57,58 +56,44 @@
{
"id": "UVLOWarningString",
"maxLen": 8,
"include": [
"POW_DC"
],
"include": ["POW_DC"],
"description": "Warning text shown when the unit turns off due to undervoltage in simple mode."
},
{
"id": "UndervoltageString",
"maxLen": 15,
"include": [
"POW_DC"
],
"include": ["POW_DC"],
"description": "Warning text shown when the unit turns off due to undervoltage in advanced mode."
},
{
"id": "InputVoltageString",
"maxLen": 11,
"note": "Preferably end with a space",
"include": [
"POW_DC"
],
"include": ["POW_DC"],
"description": "Prefix text for 'Input Voltage' shown before showing the input voltage reading."
},
{
"id": "ProfilePreheatString",
"maxLen": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Shown in profile mode while preheating"
},
{
"id": "ProfileCooldownString",
"maxLen": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Shown in profile mode while cooling down"
},
{
"id": "SleepingAdvancedString",
"maxLen": 15,
"exclude": [
"NO_SLEEP_MODE"
],
"exclude": ["NO_SLEEP_MODE"],
"description": "The text shown to indicate the unit is in sleep mode when the advanced view is turned on."
},
{
"id": "SleepingTipAdvancedString",
"maxLen": 6,
"exclude": [
"NO_SLEEP_MODE"
],
"exclude": ["NO_SLEEP_MODE"],
"description": "The prefix text shown before tip temperature when the unit is sleeping with advanced view on."
},
{
@@ -119,9 +104,7 @@
{
"id": "TooHotToStartProfileWarning",
"default": "Too hot to\nstart profile",
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Shown when profile mode is started while the device is too hot."
}
],
@@ -189,10 +172,7 @@
"id": "PowerMenu",
"maxLen": 5,
"maxLen2": 11,
"include": [
"POW_DC",
"POW_QC"
],
"include": ["POW_DC", "POW_QC"],
"description": "Menu for settings related to power. Main settings to do with the input voltage."
},
{
@@ -220,51 +200,55 @@
"description": "Advanced settings. Misc catchall for settings that don't fit anywhere else or settings that require some thought before use."
}
],
"menuValues": [
{
"id": "USBPDModeDefault",
"description": "When in this mode we enable all PD features, and we pad resistance slightly to account for cable and PCB trace loss"
},
{
"id": "USBPDModeNoDynamic",
"description": "When in this mode we only enable fixed voltage USB-PD options, and we pad resistance slightly to account for cable and PCB trace loss"
},
{
"id": "USBPDModeSafe",
"description": "When in this mode we enable all PD features, but we don't pad resistance slightly to account for cable and PCB trace loss"
}
],
"menuOptions": [
{
"id": "DCInCutoff",
"maxLen": 5,
"maxLen2": 11,
"include": [
"POW_DC"
],
"include": ["POW_DC"],
"description": "When the device is powered by a battery, this adjusts the low voltage threshold for when the unit should turn off the heater to protect the battery."
},
{
"id": "MinVolCell",
"maxLen": 4,
"maxLen2": 9,
"include": [
"POW_DC"
],
"include": ["POW_DC"],
"description": "When powered by a battery, this adjusts the minimum voltage per cell before shutdown. (This is multiplied by the cell count.)"
},
{
"id": "QCMaxVoltage",
"maxLen": 8,
"maxLen2": 15,
"include": [
"POW_QC"
],
"include": ["POW_QC"],
"description": "This adjusts the maximum voltage the QC negotiation will adjust to. Does NOT affect USB-PD. Should be set safely based on the current rating of your power supply."
},
{
"id": "PDNegTimeout",
"maxLen": 8,
"maxLen2": 15,
"include": [
"POW_PD"
],
"include": ["POW_PD"],
"description": "How long until firmware stops trying to negotiate for USB-PD and tries QC instead. Longer times may help dodgy / old PD adapters, faster times move onto PD quickly. Units of 100ms. Recommended to keep small values."
},
{
"id": "PDVpdo",
"id": "USBPDMode",
"maxLen": 7,
"maxLen2": 15,
"include": [
"POW_PD"
],
"description": "Enabled PPS & EPR modes."
"include": ["POW_PD"],
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
},
{
"id": "BoostTemperature",
@@ -300,126 +284,98 @@
"id": "ProfilePhases",
"maxLen": 6,
"maxLen2": 13,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "set the number of phases for profile mode."
},
{
"id": "ProfilePreheatTemp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Preheat to this temperature at the start of profile mode."
},
{
"id": "ProfilePreheatSpeed",
"maxLen": 5,
"maxLen2": 11,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "How fast the temperature is allowed to rise during the preheat phase at the start of profile mode."
},
{
"id": "ProfilePhase1Temp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Target temperature for the end of phase 1 of profile mode."
},
{
"id": "ProfilePhase1Duration",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Duration of phase 1 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature."
},
{
"id": "ProfilePhase2Temp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Target temperature for the end of phase 2 of profile mode."
},
{
"id": "ProfilePhase2Duration",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Duration of phase 2 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature."
},
{
"id": "ProfilePhase3Temp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Target temperature for the end of phase 3 of profile mode."
},
{
"id": "ProfilePhase3Duration",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Duration of phase 3 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature."
},
{
"id": "ProfilePhase4Temp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Target temperature for the end of phase 5 of profile mode."
},
{
"id": "ProfilePhase4Duration",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Duration of phase 5 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature."
},
{
"id": "ProfilePhase5Temp",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Target temperature for the end of phase 5 of profile mode."
},
{
"id": "ProfilePhase5Duration",
"maxLen": 4,
"maxLen2": 9,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "Duration of phase 5 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature."
},
{
"id": "ProfileCooldownSpeed",
"maxLen": 5,
"maxLen2": 11,
"include": [
"PROFILE_SUPPORT"
],
"include": ["PROFILE_SUPPORT"],
"description": "How fast the temperature is allowed to drop during the cooldown phase at the end of profile mode."
},
{
@@ -432,18 +388,14 @@
"id": "SleepTemperature",
"maxLen": 4,
"maxLen2": 9,
"exclude": [
"NO_SLEEP_MODE"
],
"exclude": ["NO_SLEEP_MODE"],
"description": "Temperature the device will drop down to while asleep. Typically around halfway between off and soldering temperature."
},
{
"id": "SleepTimeout",
"maxLen": 4,
"maxLen2": 9,
"exclude": [
"NO_SLEEP_MODE"
],
"exclude": ["NO_SLEEP_MODE"],
"description": "How long of a period without movement / button-pressing is required before the device drops down to the sleep temperature."
},
{
@@ -456,9 +408,7 @@
"id": "HallEffSensitivity",
"maxLen": 6,
"maxLen2": 13,
"include": [
"HALL_SENSOR"
],
"include": ["HALL_SENSOR"],
"description": "If the unit has a hall effect sensor (Pinecil), this adjusts how sensitive it is at detecting a magnet to put the device into sleep mode."
},
{
@@ -471,9 +421,7 @@
"id": "DisplayRotation",
"maxLen": 6,
"maxLen2": 13,
"exclude": [
"NO_DISPLAY_ROTATE"
],
"exclude": ["NO_DISPLAY_ROTATE"],
"description": "If the display should rotate automatically or if it should be fixed for left- or right-handed mode."
},
{
@@ -540,9 +488,7 @@
"id": "BluetoothLE",
"maxLen": 7,
"maxLen2": 15,
"include": [
"BLE_ENABLED"
],
"include": ["BLE_ENABLED"],
"description": "Should BLE be enabled at boot time."
},
{

View File

@@ -157,7 +157,10 @@ void FS2711::negotiate() {
// FS2711 uses mV instead of V
const uint16_t vmax = USB_PD_VMAX * 1000;
const uint8_t tip_resistance = getTipResistanceX10() + 5;
uint8_t tip_resistance = getTipResistanceX10();
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
tip_resistance += 5;
}
uint16_t pdo_min_mv = 0, pdo_max_mv = 0, pdo_max_curr = 0, pdo_type = 0;

View File

@@ -160,7 +160,7 @@ void OLED::setFramebuffer(uint8_t *buffer) {
* UTF font handling is done using the two input chars.
* Precursor is the command char that is used to select the table.
*/
void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle) {
void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const uint8_t soft_x_limit) {
const uint8_t *currentFont;
static uint8_t fontWidth, fontHeight;
uint16_t index;
@@ -175,7 +175,7 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle) {
case FontStyle::LARGE:
default:
if (charCode == '\x01' && cursor_y == 0) { // 0x01 is used as new line char
setCursor(0, 8);
setCursor(soft_x_limit, 8);
return;
} else if (charCode <= 0x01) {
return;
@@ -505,7 +505,7 @@ void OLED::setInverseDisplay(bool inverse) {
}
// print a string to the current cursor location, len chars MAX
void OLED::print(const char *const str, FontStyle fontStyle, uint8_t len) {
void OLED::print(const char *const str, FontStyle fontStyle, uint8_t len, const uint8_t soft_x_limit) {
const uint8_t *next = reinterpret_cast<const uint8_t *>(str);
if (next[0] == 0x01) {
fontStyle = FontStyle::LARGE;
@@ -523,7 +523,7 @@ void OLED::print(const char *const str, FontStyle fontStyle, uint8_t len) {
index = (next[0] - 0xF0) * 0xFF - 15 + next[1];
next += 2;
}
drawChar(index, fontStyle);
drawChar(index, fontStyle, soft_x_limit);
}
}
@@ -580,7 +580,7 @@ void OLED::drawHex(uint32_t x, FontStyle fontStyle, uint8_t digits) {
// print number to hex
for (uint_fast8_t i = 0; i < digits; i++) {
uint16_t value = (x >> (4 * (7 - i))) & 0b1111;
drawChar(value + 2, fontStyle);
drawChar(value + 2, fontStyle, 0);
}
}
@@ -635,7 +635,7 @@ void OLED::debugNumber(int32_t val, FontStyle fontStyle) {
void OLED::drawSymbol(uint8_t symbolID) {
// draw a symbol to the current cursor location
drawChar(symbolID, FontStyle::EXTRAS);
drawChar(symbolID, FontStyle::EXTRAS, 0);
}
// Draw an area, but y must be aligned on 0/8 offset

View File

@@ -78,10 +78,7 @@ enum class FontStyle {
class OLED {
public:
enum DisplayState : bool {
OFF = false,
ON = true
};
enum DisplayState : bool { OFF = false, ON = true };
static void initialize(); // Startup the I2C coms (brings screen out of reset etc)
static bool isInitDone();
@@ -120,7 +117,7 @@ public:
static void setInverseDisplay(bool inverted);
static int16_t getCursorX() { return cursor_x; }
// Draw a string to the current location, with selected font; optionally - with MAX length only
static void print(const char *string, FontStyle fontStyle, uint8_t length = 255);
static void print(const char *string, FontStyle fontStyle, uint8_t length = 255, const uint8_t soft_x_limit = 0);
static void printWholeScreen(const char *string);
// Print *F or *C - in font style of Small, Large (by default) or Extra based on input arg
static void printSymbolDeg(FontStyle fontStyle = FontStyle::LARGE);
@@ -166,7 +163,7 @@ private:
displayChecksum = hash;
return result;
}
static void drawChar(uint16_t charCode, FontStyle fontStyle); // Draw a character to the current cursor location
static void drawChar(uint16_t charCode, FontStyle fontStyle, const uint8_t soft_x_limit); // Draw a character to the current cursor location
static void setFramebuffer(uint8_t *buffer);
static uint8_t *stripPointers[4]; // Pointers to the strips to allow for buffer having extra content
static bool inLeftHandedMode; // Whether the screen is in left or not (used for offsets in GRAM)

View File

@@ -135,7 +135,10 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
*bestVoltage = 5000; // Default 5V
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
uint8_t tipResistance = getTipResistanceX10() + 5;
uint8_t tipResistance = getTipResistanceX10();
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
tipResistance += 5;
}
#ifdef MODEL_HAS_DCDC
// If this device has step down DC/DC inductor to smooth out current spikes
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit
@@ -167,7 +170,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
}
}
}
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && getSettingValue(SettingsOptions::PDVpdo)) {
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && getSettingValue(SettingsOptions::USBPDMode)) {
bool sourceIsEPRCapable = lastCapabilities[0] & PD_PDO_SRC_FIXED_EPR_CAPABLE;
bool isPPS = false;
bool isAVS = false;

View File

@@ -22,7 +22,10 @@ int32_t Utils::InterpolateLookupTable(const int32_t *lookupTable, const int noIt
int32_t Utils::LinearInterpolate(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x) { return y1 + (((((x - x1) * 1000) / (x2 - x1)) * (y2 - y1))) / 1000; }
uint16_t Utils::RequiredCurrentForTipAtVoltage(uint16_t voltageX10) {
uint8_t tipResistancex10 = getTipResistanceX10() + 5;
uint8_t tipResistancex10 = getTipResistanceX10();
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
tipResistancex10 += 5;
}
#ifdef MODEL_HAS_DCDC
// If this device has step down DC/DC inductor to smooth out current spikes
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit

View File

@@ -52,7 +52,7 @@ enum SettingsOptions {
LOGOTime = 35, // Duration the logo will be displayed for
CalibrateCJC = 36, // Toggle calibrate CJC at next boot
BluetoothLE = 37, // Toggle BLE if present
PDVpdo = 38, // Toggle PPS & EPR
USBPDMode = 38, // Toggle PPS & EPR
ProfilePhases = 39, // Number of profile mode phases
ProfilePreheatTemp = 40, // Temperature to preheat to before the first phase
ProfilePreheatSpeed = 41, // Maximum allowed preheat speed in degrees per second

View File

@@ -59,7 +59,7 @@ enum class SettingsItemIndex : uint8_t {
MinVolCell,
QCMaxVoltage,
PDNegTimeout,
PDVpdo,
USBPDMode,
BoostTemperature,
AutoStart,
TempChangeShortStep,
@@ -145,6 +145,9 @@ struct TranslationIndexTable {
uint16_t SettingStartSleepOffChar;
uint16_t SettingLockBoostChar;
uint16_t SettingLockFullChar;
uint16_t USBPDModeDefault;
uint16_t USBPDModeNoDynamic;
uint16_t USBPDModeSafe;
uint16_t SettingsDescriptions[static_cast<uint32_t>(SettingsItemIndex::NUM_ITEMS)];
uint16_t SettingsShortNames[static_cast<uint32_t>(SettingsItemIndex::NUM_ITEMS)];

View File

@@ -89,7 +89,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{ 0, 6, 1, 1}, // LOGOTime
{ 0, 1, 1, 0}, // CalibrateCJC
{ 0, 1, 1, 0}, // BluetoothLE
{ 0, 1, 1, 1}, // PDVpdo
{ 0, 2, 1, 1}, // USBPDMode
{ 1, 5, 1, 4}, // ProfilePhases
{ MIN_TEMP_C, MAX_TEMP_F, 5, 90}, // ProfilePreheatTemp
{ 1, 10, 1, 1}, // ProfilePreheatSpeed

View File

@@ -26,7 +26,7 @@ static void displayQCInputV(void);
#ifdef POW_PD
static void displayPDNegTimeout(void);
static void displayPDVpdo(void);
static void displayUSBPDMode(void);
#endif /* POW_PD */
static void displaySensitivity(void);
@@ -131,7 +131,7 @@ static void displayAdvancedMenu(void);
* -Minimum Voltage
* QC Voltage
* PD Timeout
* PDVpdo
* USBPDMode
*
* Soldering
* Boost Mode Temp
@@ -232,7 +232,7 @@ const menuitem powerMenu[] = {
* -Minimum Voltage
* QC Voltage
* PD Timeout
* PDVpdo
* USBPDMode
*/
#ifdef POW_DC
/* Voltage input */
@@ -248,7 +248,7 @@ const menuitem powerMenu[] = {
/* PD timeout setup */
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6},
/* Toggle PPS & EPR */
{SETTINGS_DESC(SettingsItemIndex::PDVpdo), nullptr, displayPDVpdo, nullptr, SettingsOptions::PDVpdo, SettingsItemIndex::PDVpdo, 7},
{SETTINGS_DESC(SettingsItemIndex::USBPDMode), nullptr, displayUSBPDMode, nullptr, SettingsOptions::USBPDMode, SettingsItemIndex::USBPDMode, 4},
#endif
/* vvvv end of menu marker. DO NOT REMOVE vvvv */
{0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0}
@@ -529,7 +529,26 @@ static void displayPDNegTimeout(void) {
}
}
static void displayPDVpdo(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::PDVpdo)); }
static void displayUSBPDMode(void) {
/*
* PD Mode
* 0 = Safe mode, no PPS, no EPR
* 1 = Default mode, tolerant + PPS + EPR
* 2 = Strict mode + PPS + EPR
*/
switch (getSettingValue(SettingsOptions::USBPDMode)) {
case 1:
OLED::print(translatedString(Tr->USBPDModeDefault), FontStyle::SMALL, 255, OLED::getCursorX());
break;
case 2:
OLED::print(translatedString(Tr->USBPDModeSafe), FontStyle::SMALL, 255, OLED::getCursorX());
break;
default:
OLED::print(translatedString(Tr->USBPDModeNoDynamic), FontStyle::SMALL, 255, OLED::getCursorX());
break;
}
}
#endif /* POW_PD */

View File

@@ -256,7 +256,7 @@ if __name__ == "__main__":
sys.exit(1)
for hexf in options.hexfiles:
ih = IntelHex(hexf)
for (address, end) in ih.segments():
for address, end in ih.segments():
try:
address = address & 0xFFFFFFFF
except ValueError:

View File

@@ -12,8 +12,12 @@ import sys
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("Usage: metadata.py OUTPUT_FILE [model]")
print(" OUTPUT_FILE - the name of output file in json format with meta info about binary files")
print(" model [optional] - name of the model (as for `make model=NAME`) to scan files for explicitly (all files in source/Hexfile by default otherwise)")
print(
" OUTPUT_FILE - the name of output file in json format with meta info about binary files"
)
print(
" model [optional] - name of the model (as for `make model=NAME`) to scan files for explicitly (all files in source/Hexfile by default otherwise)"
)
exit(1)
# If model is provided explicitly to scan related files only for json output, then process the argument
@@ -30,16 +34,19 @@ HexFileFolder = os.path.join(HERE, "Hexfile")
OutputJSONPath = os.path.join(HexFileFolder, sys.argv[1])
TranslationsFilesPath = os.path.join(HERE.parent, "Translations")
def load_json(filename: str):
with open(filename) as f:
return json.loads(f.read())
def read_git_tag():
if os.environ.get("GITHUB_CI_PR_SHA", "") != "":
return os.environ["GITHUB_CI_PR_SHA"][:7].upper()
else:
return f"{subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD']).strip().decode('ascii').upper()}"
def read_version():
with open(HERE / "version.h") as version_file:
for line in version_file:
@@ -49,9 +56,18 @@ def read_version():
return matches[0]
raise Exception("Could not parse version")
# Fetch our file listings
translation_files = [os.path.join(TranslationsFilesPath, f) for f in os.listdir(TranslationsFilesPath) if os.path.isfile(os.path.join(TranslationsFilesPath, f)) and f.endswith(".json")]
output_files = [os.path.join(HexFileFolder, f) for f in sorted(os.listdir(HexFileFolder)) if os.path.isfile(os.path.join(HexFileFolder, f))]
translation_files = [
os.path.join(TranslationsFilesPath, f)
for f in os.listdir(TranslationsFilesPath)
if os.path.isfile(os.path.join(TranslationsFilesPath, f)) and f.endswith(".json")
]
output_files = [
os.path.join(HexFileFolder, f)
for f in sorted(os.listdir(HexFileFolder))
if os.path.isfile(os.path.join(HexFileFolder, f))
]
parsed_languages = {}
for path in translation_files:
@@ -74,7 +90,9 @@ for file_path in output_files:
if not name.startswith(ModelName + "_"):
continue
# If build of interest is not multi-lang one but scanning one is not MODEL_LANG-ID here, then skip it to avoid mess in json between MODEL_LANG-ID & MODEL_multi'
if not ModelName.endswith("_multi") and not re.match(r"^" + ModelName + "_" + "([A-Z]+).*$", name):
if not ModelName.endswith("_multi") and not re.match(
r"^" + ModelName + "_" + "([A-Z]+).*$", name
):
continue
matches = re.findall(r"^([a-zA-Z0-9]+)_(.+)\.(.+)$", name)
if matches:
@@ -86,10 +104,17 @@ for file_path in output_files:
lang_file = parsed_languages.get(lang_code, None)
if lang_file is None and lang_code.startswith("multi_"):
# Multi files wont match, but we fake this by just taking the filename to it
lang_file = {"languageLocalName": lang_code.replace("multi_", "").replace("compressed_", "")}
lang_file = {
"languageLocalName": lang_code.replace("multi_", "").replace(
"compressed_", ""
)
}
if lang_file is None:
raise Exception(f"Could not match language code {lang_code}")
file_record = {"language_code": lang_code, "language_name": lang_file.get("languageLocalName", None)}
file_record = {
"language_code": lang_code,
"language_name": lang_file.get("languageLocalName", None),
}
output_json["contents"][name] = file_record
else:
print(f"failed to parse {matches}")