From f81257562d31234ac9355f1afcb46a61af4eacf5 Mon Sep 17 00:00:00 2001 From: alextrical <35117191+alextrical@users.noreply.github.com> Date: Fri, 30 Jun 2023 15:57:11 +0100 Subject: [PATCH 1/4] Tip short detection at boot If tip is shorted at boot, prevent the FW from running, with the intent to prevent the MOSFET from being damaged --- source/Core/BSP/Pinecilv2/BSP.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/Core/BSP/Pinecilv2/BSP.cpp b/source/Core/BSP/Pinecilv2/BSP.cpp index 28646a18b..d49dd6536 100644 --- a/source/Core/BSP/Pinecilv2/BSP.cpp +++ b/source/Core/BSP/Pinecilv2/BSP.cpp @@ -206,6 +206,11 @@ void FinishMeasureTipResistance() { uint8_t newRes = 0; if (reading > 8000) { // return; // Change nothing as probably disconnected tip + } else if (reading < 500) { + for (;;) /* Tip shorted, wait until reset */ + { + __NOP(); + } } else if (reading < 4000) { newRes = 62; } else { From 7254b78404186c60737aac8c19e6fb975b170ce9 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 28 Jul 2023 19:58:27 +1000 Subject: [PATCH 2/4] Add warning for Tip Shorted to translations --- Translations/translation_BE.json | 5 +- Translations/translation_BG.json | 5 +- Translations/translation_CS.json | 5 +- Translations/translation_DA.json | 3 + Translations/translation_DE.json | 3 + Translations/translation_EL.json | 3 + Translations/translation_EN.json | 3 + Translations/translation_ES.json | 3 + Translations/translation_FI.json | 3 + Translations/translation_FR.json | 3 + Translations/translation_HR.json | 3 + Translations/translation_HU.json | 3 + Translations/translation_IT.json | 3 + Translations/translation_JA_JP.json | 3 + Translations/translation_LT.json | 3 + Translations/translation_NB.json | 3 + Translations/translation_NL.json | 3 + Translations/translation_NL_BE.json | 3 + Translations/translation_PL.json | 3 + Translations/translation_PT.json | 3 + Translations/translation_RO.json | 3 + Translations/translation_RU.json | 3 + Translations/translation_SK.json | 3 + Translations/translation_SL.json | 3 + Translations/translation_SR_CYRL.json | 3 + Translations/translation_SR_LATN.json | 3 + Translations/translation_SV.json | 3 + Translations/translation_TR.json | 3 + Translations/translation_UK.json | 3 + Translations/translation_VI.json | 3 + Translations/translation_YUE_HK.json | 3 + Translations/translation_ZH_CN.json | 5 +- Translations/translation_ZH_TW.json | 5 +- Translations/translations_definitions.json | 162 +++++++++++++++------ source/Core/Inc/Translation.h | 1 + 35 files changed, 226 insertions(+), 46 deletions(-) diff --git a/Translations/translation_BE.json b/Translations/translation_BE.json index 72ddf0f51..6c388d188 100644 --- a/Translations/translation_BE.json +++ b/Translations/translation_BE.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Некантралюемае\nразаграванне" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Пераканайцеся, што пры наступнай загрузцы наканечнік і ручка маюць пакаёвую тэмпературу!" }, @@ -313,4 +316,4 @@ "description": "" } } -} +} \ No newline at end of file diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index 72b4f49fe..20b1c9367 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, @@ -313,4 +316,4 @@ "description": "" } } -} +} \ No newline at end of file diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index fb4c4d1f0..47293390b 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Teplotní\nOchrana" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Před restartem se ujistěte, že hrot a držák mají pokojovou teplotu!" }, @@ -313,4 +316,4 @@ "description": "" } } -} +} \ No newline at end of file diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index 12625a67c..37ba8a3bc 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index 8ba129a3d..efe8b3709 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Vor dem Neustart bitte sicherstellen, dass Lötspitze & Gerät Raumtemperatur haben!" }, diff --git a/Translations/translation_EL.json b/Translations/translation_EL.json index ae81203d9..58afba384 100644 --- a/Translations/translation_EL.json +++ b/Translations/translation_EL.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Θερμική\nΦυγή" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Πριν την επανεκκίνηση, βεβαιωθείτε ότι η μύτη και η συσκ. είναι σε θερμ. δωματίου!" }, diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index 874095628..3ea0a4189 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index ad352fd3d..c1b8d2648 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Térmico\nFuera de control" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "¡Antes de reiniciar, asegúrese de que la punta y el mango estén a temperatura ambiente!" }, diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index 9bb4e90c5..c0bd61d0a 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index 1078b29a9..c0d661b0e 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Emballement\nthermique" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Avant de redémarrer, assurez-vous que la panne et la poignée sont à température ambiante !" }, diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index 093e66f78..0edc2ea13 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Neispravan\ngrijač" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Prije restarta provjerite da su vrh i ručka na sobnoj temperaturi!" }, diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index 449a28c31..d89328046 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Kontrollálatlan\nhőmérséklet!" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Újraindítás előtt a hegy és az eszköz legyen szobahőmérsékletű!" }, diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index e1b7d32be..89d0f44b1 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Temperatura\nfuori controllo" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Prima di riavviare assicurati che la punta e l'impugnatura siano a temperatura ambiente!" }, diff --git a/Translations/translation_JA_JP.json b/Translations/translation_JA_JP.json index 74a3cd0cf..597c418f8 100755 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "過熱" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index 96387be6d..309566036 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Perkaitimo\npavojus" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_NB.json b/Translations/translation_NB.json index f716171fb..fba747267 100644 --- a/Translations/translation_NB.json +++ b/Translations/translation_NB.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Termisk\nrømling" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index 4a1d2d563..a8c279fe3 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Verwarming\nOncontroleerbaar" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index 29767d8eb..b8858a7ff 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index 604e8e29e..534ac2e3f 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Ucieczka\ntermiczna" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Upewnij się, że końcówka i uchwyt mają temperaturę pokojową podczas następnego rozruchu!" }, diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index 13078f7fb..84f0396b6 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Antes de reiniciar certifique-se que o ferro está à temperatura ambiente!" }, diff --git a/Translations/translation_RO.json b/Translations/translation_RO.json index b40e8d16f..772c42642 100644 --- a/Translations/translation_RO.json +++ b/Translations/translation_RO.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Încălzire\nEşuată" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Înainte de repornire, asiguraţi-vă că vârful şi mânerul sunt la temperatura camerei!" }, diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 626508192..1b44a3f2f 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Неуправляемый\nРазогрев" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Пожалуйста, убедитесь, что жало и корпус имеют комнатную температуру при следующей загрузке!" }, diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index b0b550ad2..19115ed15 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Únik\nTepla" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 5e7d2d6dd..6e8ceac6d 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index 6d8ab8a39..543d03785 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index c3eedfcbd..5447bbe9c 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index 58d6f6d8c..3380709e7 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index 3a22cd196..8a4055721 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Thermal\nRunaway" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index 03a470570..a3be4b292 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Некерований\nрозігрів" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Під час наступного завантаження переконайтеся, що жало і ручка мають кімнатну температуру!" }, diff --git a/Translations/translation_VI.json b/Translations/translation_VI.json index 10c36e0b0..477a6d678 100644 --- a/Translations/translation_VI.json +++ b/Translations/translation_VI.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "Nhiet\nTat gia nhiet" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index 745e6801a..f28e7f268 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "加熱失控" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, diff --git a/Translations/translation_ZH_CN.json b/Translations/translation_ZH_CN.json index de08f6967..5f74ea313 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "加热失控" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, @@ -313,4 +316,4 @@ "description": "" } } -} +} \ No newline at end of file diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 1094e3aab..49e9da555 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -30,6 +30,9 @@ "WarningThermalRunaway": { "message": "加熱失控" }, + "WarningTipShorted": { + "message": "!Tip Shorted!" + }, "SettingsCalibrationWarning": { "message": "Before rebooting, make sure tip & handle are at room temperature!" }, @@ -313,4 +316,4 @@ "description": "" } } -} +} \ No newline at end of file diff --git a/Translations/translations_definitions.json b/Translations/translations_definitions.json index 96d237b7e..4d2051d3f 100644 --- a/Translations/translations_definitions.json +++ b/Translations/translations_definitions.json @@ -1,5 +1,6 @@ { - "messagesWarn": [{ + "messagesWarn": [ + { "id": "CJCCalibrationDone", "description": "Confirmation message indicating CJC calibration is complete." }, @@ -17,7 +18,9 @@ }, { "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." }, { @@ -35,7 +38,12 @@ { "id": "WarningThermalRunaway", "description": "Warning text shown when the software has disabled the heater as a safety precaution as the temperature reading didn't react as expected." - }, { + }, + { + "id": "WarningTipShorted", + "description": "Warning text shown when the software has detected that the users tip is likely shorted." + }, + { "id": "SettingsCalibrationWarning", "description": "Confirmation message shown before performing an offset calibration. Should warn the user to make sure tip and handle are at the same temperature." }, @@ -50,50 +58,66 @@ { "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": "SleepingSimpleString", "maxLen": 4, - "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 NOT on." }, { "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." }, { @@ -109,11 +133,14 @@ { "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." } ], - "characters": [{ + "characters": [ + { "id": "SettingRightChar", "len": 1, "description": "Shown for fixed Right-handed display rotation." @@ -187,11 +214,15 @@ "description": "Shown when the locking mode is set to lock all buttons." } ], - "menuGroups": [{ + "menuGroups": [ + { "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." }, { @@ -219,39 +250,50 @@ "description": "Advanced settings. Misc catchall for settings that don't fit anywhere else or settings that require some thought before use." } ], - "menuOptions": [{ + "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", "maxLen": 7, "maxLen2": 15, - "include": ["POW_PD"], + "include": [ + "POW_PD" + ], "description": "Enabled PPS & EPR modes." }, { @@ -288,98 +330,126 @@ "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." }, { @@ -392,14 +462,18 @@ "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." }, { @@ -412,7 +486,9 @@ "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." }, { @@ -425,7 +501,9 @@ "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." }, { @@ -492,7 +570,9 @@ "id": "BluetoothLE", "maxLen": 7, "maxLen2": 15, - "include": ["BLE_ENABLED"], + "include": [ + "BLE_ENABLED" + ], "description": "Should BLE be enabled at boot time." }, { @@ -544,4 +624,4 @@ "description": "Changes the device language on multi-lingual builds." } ] -} +} \ No newline at end of file diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 1f1f39649..abd0e01ee 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -116,6 +116,7 @@ struct TranslationIndexTable { uint16_t UnlockingKeysString; uint16_t WarningKeysLockedString; uint16_t WarningThermalRunaway; + uint16_t WarningTipShorted; uint16_t SettingsCalibrationWarning; uint16_t CJCCalibrating; From 13e1c2415218260ef489ddb7ab9d3a977c3aa719 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 28 Jul 2023 19:58:46 +1000 Subject: [PATCH 3/4] Warn user tick type correction --- source/Core/Inc/settingsGUI.hpp | 4 +++- .../utils/OperatingModeUtilities.h | 24 +++++++++---------- .../OperatingModes/utils/ShowWarning.cpp | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/source/Core/Inc/settingsGUI.hpp b/source/Core/Inc/settingsGUI.hpp index f0c252971..f1d908525 100644 --- a/source/Core/Inc/settingsGUI.hpp +++ b/source/Core/Inc/settingsGUI.hpp @@ -8,9 +8,11 @@ #ifndef GUI_HPP_ #define GUI_HPP_ #include "BSP.h" +#include "FreeRTOS.h" #include "Settings.h" #include "Translation.h" + #define PRESS_ACCEL_STEP (TICKS_100MS / 3) #define PRESS_ACCEL_INTERVAL_MIN TICKS_100MS #define PRESS_ACCEL_INTERVAL_MAX (TICKS_100MS * 3) @@ -35,7 +37,7 @@ typedef struct { } menuitem; void enterSettingsMenu(); -void warnUser(const char *warning, const int timeout); +void warnUser(const char *warning, const TickType_t timeout); extern const menuitem rootSettingsMenu[]; #endif /* GUI_HPP_ */ diff --git a/source/Core/Threads/OperatingModes/utils/OperatingModeUtilities.h b/source/Core/Threads/OperatingModes/utils/OperatingModeUtilities.h index 4484ee0c3..ab3f36f99 100644 --- a/source/Core/Threads/OperatingModes/utils/OperatingModeUtilities.h +++ b/source/Core/Threads/OperatingModes/utils/OperatingModeUtilities.h @@ -3,16 +3,16 @@ #include "OLED.hpp" #include -void GUIDelay(); // -bool checkForUnderVoltage(void); // -uint32_t getSleepTimeout(void); // -bool shouldBeSleeping(bool inAutoStart); // -bool shouldShutdown(void); // -void gui_drawTipTemp(bool symbol, const FontStyle font); // -void printVoltage(void); // -void warnUser(const char *warning, const int timeout); // -void gui_drawBatteryIcon(void); // -bool checkForUnderVoltage(void); // -uint16_t min(uint16_t a, uint16_t b); // -void printCountdownUntilSleep(int sleepThres); // +void GUIDelay(); // +bool checkForUnderVoltage(void); // +uint32_t getSleepTimeout(void); // +bool shouldBeSleeping(bool inAutoStart); // +bool shouldShutdown(void); // +void gui_drawTipTemp(bool symbol, const FontStyle font); // +void printVoltage(void); // +void warnUser(const char *warning, const TickType_t timeout); // +void gui_drawBatteryIcon(void); // +bool checkForUnderVoltage(void); // +uint16_t min(uint16_t a, uint16_t b); // +void printCountdownUntilSleep(int sleepThres); // #endif \ No newline at end of file diff --git a/source/Core/Threads/OperatingModes/utils/ShowWarning.cpp b/source/Core/Threads/OperatingModes/utils/ShowWarning.cpp index 58370cb7e..fcd2972e2 100644 --- a/source/Core/Threads/OperatingModes/utils/ShowWarning.cpp +++ b/source/Core/Threads/OperatingModes/utils/ShowWarning.cpp @@ -1,6 +1,6 @@ #include "Buttons.hpp" #include "OperatingModeUtilities.h" -void warnUser(const char *warning, const int timeout) { +void warnUser(const char *warning, const TickType_t timeout) { OLED::clearScreen(); OLED::printWholeScreen(warning); OLED::refresh(); From 344068d480f47e2bcbb0e07388e6ff074d90fa23 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 28 Jul 2023 19:59:54 +1000 Subject: [PATCH 4/4] Add isTipShorted() to warnings --- source/Core/BSP/BSP.h | 2 ++ source/Core/BSP/MHP30/Power.cpp | 3 ++- source/Core/BSP/Miniware/BSP.cpp | 11 +++++++++-- source/Core/BSP/Pinecil/BSP.cpp | 2 +- source/Core/BSP/Pinecilv2/BSP.cpp | 14 ++++++-------- source/Core/BSP/Sequre_S60/BSP.cpp | 2 +- .../Threads/OperatingModes/ShowStartupWarnings.cpp | 4 ++++ 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/source/Core/BSP/BSP.h b/source/Core/BSP/BSP.h index 732a3adcf..db9f9814d 100644 --- a/source/Core/BSP/BSP.h +++ b/source/Core/BSP/BSP.h @@ -101,6 +101,8 @@ void setBuzzer(bool on); // For example, on the MHP30 this is used to figure out the resistance of the hotplate uint8_t preStartChecks(); uint8_t preStartChecksDone(); + +bool isTipShorted(); #ifdef __cplusplus } #endif diff --git a/source/Core/BSP/MHP30/Power.cpp b/source/Core/BSP/MHP30/Power.cpp index 827fac6cb..83c95c62a 100644 --- a/source/Core/BSP/MHP30/Power.cpp +++ b/source/Core/BSP/MHP30/Power.cpp @@ -18,4 +18,5 @@ void power_check() { bool getIsPoweredByDCIN() { return false; } -uint8_t getTipResistanceX10() { return TIP_RESISTANCE; } \ No newline at end of file +uint8_t getTipResistanceX10() { return TIP_RESISTANCE; } +bool isTipShorted() { return false; } \ No newline at end of file diff --git a/source/Core/BSP/Miniware/BSP.cpp b/source/Core/BSP/Miniware/BSP.cpp index f14612582..fe0068be2 100644 --- a/source/Core/BSP/Miniware/BSP.cpp +++ b/source/Core/BSP/Miniware/BSP.cpp @@ -284,6 +284,7 @@ void performTipResistanceSampleReading() { tipResistanceReadingSlot++; } +bool tipShorted = false; void FinishMeasureTipResistance() { // Otherwise we now have the 4 samples; @@ -303,6 +304,8 @@ void FinishMeasureTipResistance() { // return; // Change nothing as probably disconnected tip tipResistanceReadingSlot = lastTipResistance = 0; return; + } else if (reading < 200) { + tipShorted = true; } else if (reading < 800) { newRes = 62; } else { @@ -372,7 +375,7 @@ uint64_t getDeviceID() { uint8_t preStartChecksDone() { #ifdef TIP_RESISTANCE_SENSE_Pin - return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring) ? 0 : 1; + return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring || tipShorted) ? 0 : 1; #else return 1; #endif @@ -387,7 +390,11 @@ uint8_t getTipResistanceX10() { return TIP_RESISTANCE; #endif } - +#ifdef TIP_RESISTANCE_SENSE_Pin +bool isTipShorted() { return tipShorted; } +#else +bool isTipShorted() { return false; } +#endif uint8_t getTipThermalMass() { #ifdef TIP_RESISTANCE_SENSE_Pin if (lastTipResistance >= 80) { diff --git a/source/Core/BSP/Pinecil/BSP.cpp b/source/Core/BSP/Pinecil/BSP.cpp index bbbfbb19e..ca9817f5a 100644 --- a/source/Core/BSP/Pinecil/BSP.cpp +++ b/source/Core/BSP/Pinecil/BSP.cpp @@ -93,7 +93,7 @@ uint8_t preStartChecks() { return 1; } uint64_t getDeviceID() { return dbg_id_get(); } uint8_t getTipResistanceX10() { return TIP_RESISTANCE; } - +bool isTipShorted() { return false; } uint8_t preStartChecksDone() { return 1; } uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } diff --git a/source/Core/BSP/Pinecilv2/BSP.cpp b/source/Core/BSP/Pinecilv2/BSP.cpp index d49dd6536..98476e078 100644 --- a/source/Core/BSP/Pinecilv2/BSP.cpp +++ b/source/Core/BSP/Pinecilv2/BSP.cpp @@ -187,7 +187,7 @@ void performTipResistanceSampleReading() { gpio_write(TIP_RESISTANCE_SENSE, tipResistanceReadingSlot == 0); tipResistanceReadingSlot++; } - +bool tipShorted = false; void FinishMeasureTipResistance() { // Otherwise we now have the 4 samples; @@ -207,10 +207,7 @@ void FinishMeasureTipResistance() { if (reading > 8000) { // return; // Change nothing as probably disconnected tip } else if (reading < 500) { - for (;;) /* Tip shorted, wait until reset */ - { - __NOP(); - } + tipShorted = true; } else if (reading < 4000) { newRes = 62; } else { @@ -220,8 +217,8 @@ void FinishMeasureTipResistance() { } volatile bool tipMeasurementOccuring = true; volatile TickType_t nextTipMeasurement = 100; - -void performTipMeasurementStep() { +bool isTipShorted() { return tipShorted; } +void performTipMeasurementStep() { // Wait 100ms for settle time if (xTaskGetTickCount() < (nextTipMeasurement)) { @@ -243,7 +240,8 @@ uint8_t preStartChecks() { performTipMeasurementStep(); return preStartChecksDone(); } -uint8_t preStartChecksDone() { return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring) ? 0 : 1; } +// If we are still measuring the tip; or tip is shorted; prevent heating +uint8_t preStartChecksDone() { return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring || tipShorted) ? 0 : 1; } // Return hardware unique ID if possible uint64_t getDeviceID() { diff --git a/source/Core/BSP/Sequre_S60/BSP.cpp b/source/Core/BSP/Sequre_S60/BSP.cpp index 8a41d18b9..7fe84f00d 100644 --- a/source/Core/BSP/Sequre_S60/BSP.cpp +++ b/source/Core/BSP/Sequre_S60/BSP.cpp @@ -230,7 +230,7 @@ uint64_t getDeviceID() { } uint8_t getTipResistanceX10() { return TIP_RESISTANCE; } - +bool isTipShorted() { return false; } uint8_t preStartChecksDone() { return 1; } uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } diff --git a/source/Core/Threads/OperatingModes/ShowStartupWarnings.cpp b/source/Core/Threads/OperatingModes/ShowStartupWarnings.cpp index 8c8b6dd1a..62ed5d0e8 100644 --- a/source/Core/Threads/OperatingModes/ShowStartupWarnings.cpp +++ b/source/Core/Threads/OperatingModes/ShowStartupWarnings.cpp @@ -48,5 +48,9 @@ void showWarnings(void) { } } #endif /*POW_PD_EXT==1*/ + // If tip looks to be shorted, yell at user and dont auto dismiss + if (isTipShorted()) { + warnUser(translatedString(Tr->WarningTipShorted), portMAX_DELAY); + } #endif /*NO_WARN_MISSING*/ }