From def2aa89fd09d048abcb77ad4afc8b11d665d889 Mon Sep 17 00:00:00 2001 From: PlayDay <18056374+playday3008@users.noreply.github.com> Date: Sun, 7 Mar 2021 11:34:04 +0100 Subject: [PATCH] Add more voltage settings --- Translations/make_translation.py | 1 + Translations/translation_BG.json | 14 +++++ Translations/translation_CS.json | 14 +++++ Translations/translation_DA.json | 14 +++++ Translations/translation_DE.json | 14 +++++ Translations/translation_EN.json | 14 +++++ Translations/translation_ES.json | 14 +++++ Translations/translation_FI.json | 14 +++++ Translations/translation_FR.json | 14 +++++ Translations/translation_HR.json | 14 +++++ Translations/translation_HU.json | 14 +++++ Translations/translation_IT.json | 14 +++++ Translations/translation_LT.json | 14 +++++ Translations/translation_NL.json | 14 +++++ Translations/translation_NL_BE.json | 14 +++++ Translations/translation_NO.json | 14 +++++ Translations/translation_PL.json | 14 +++++ Translations/translation_PT.json | 14 +++++ Translations/translation_RU.json | 14 +++++ Translations/translation_SK.json | 14 +++++ Translations/translation_SL.json | 14 +++++ Translations/translation_SR_CYRL.json | 14 +++++ Translations/translation_SR_LATN.json | 14 +++++ Translations/translation_SV.json | 14 +++++ Translations/translation_TR.json | 14 +++++ Translations/translation_UK.json | 14 +++++ Translations/translation_YUE_HK.json | 14 +++++ Translations/translation_ZH_TW.json | 14 +++++ Translations/translations_def.js | 15 ++++- source/Core/Drivers/Font.h | 36 ++++++++++++ source/Core/Inc/Settings.h | 1 + source/Core/Inc/Translation.h | 3 +- source/Core/Src/Settings.cpp | 3 +- source/Core/Src/gui.cpp | 80 ++++++++++++++++++++------- source/configuration.h | 7 ++- 35 files changed, 498 insertions(+), 26 deletions(-) diff --git a/Translations/make_translation.py b/Translations/make_translation.py index 38171344..68483673 100755 --- a/Translations/make_translation.py +++ b/Translations/make_translation.py @@ -100,6 +100,7 @@ def getConstants(): consants.append(("SymbolWatts", "W")) consants.append(("SymbolVolts", "V")) consants.append(("SymbolDC", "DC")) + consants.append(("SymbolNA", "N/A")) consants.append(("SymbolCellCount", "S")) consants.append(("SymbolVersionNumber", buildVersion)) return consants diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index 3fb24b8e..9d76adc6 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Поялник", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index af1103c9..b5e8f196 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Pájecí", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index b98220a1..8d01757d 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Soldering", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index 34eeae44..3aa14041 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -50,6 +50,13 @@ "SettingLockFullChar": "V" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Löt-", @@ -275,6 +282,13 @@ "sperre" ], "desc": "Langes drücken beider Tasten im Lötmodus sperrt diese " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index d208a386..f24e6ba6 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -50,6 +50,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Soldering", @@ -275,6 +282,13 @@ "buttons" ], "desc": "When soldering, long press both buttons, to lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index 8adca0d9..269bbae8 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Ajustes de", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index d2319978..a9ba9308 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Juotos-", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index a9b7e15e..33c357f0 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "V" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Paramètres", @@ -274,6 +281,13 @@ "capteur effet hall" ], "desc": "Sensibilité du capteur à effet Hall lors de la détection de mise en veille " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index 11f6c884..3b0e08a5 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Postavke", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index 03d549a3..d07f84d6 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "T" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Forrasztási", @@ -274,6 +281,13 @@ "enged." ], "desc": "Forrasztás közben mindkét gombot hosszan lenyomva rögzíti a hőmérsékletet (K=ki B=csak \"boost\" mód T=teljes lezárás)" + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index cd1fd539..6d094fcb 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "C" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Opzioni", @@ -274,6 +281,13 @@ "tasti" ], "desc": "Blocca i tasti durante la modalità Saldatura; tieni premuto entrambi per bloccare/sbloccare " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index 3563bcca..f6736a37 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "V" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Litavimo", @@ -274,6 +281,13 @@ "užraktas" ], "desc": "Lituodami, ilgai paspauskite abu mygtukus, kad juos užrakintumėte " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index d4abf365..ae6de8ed 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -49,6 +49,13 @@ "SettingSensitivityHigh": "H" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Soldeer", @@ -274,6 +281,13 @@ "knoppen" ], "desc": "Tijdens solderen lang op beide knoppen drukken, blokkeert ze. " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index 2713d418..1644e038 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Soldeer", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_NO.json b/Translations/translation_NO.json index fa90ecf4..06996705 100644 --- a/Translations/translation_NO.json +++ b/Translations/translation_NO.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Lodde-", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index 1a92b0f9..6da7e2bb 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -50,6 +50,13 @@ "SettingLockFullChar": "P" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Lutowanie", @@ -275,6 +282,13 @@ "przycisków" ], "desc": "W trybie lutowania, wciśnij oba przyciski aby je zablokować " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index 4bf003d1..d2dcbf63 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Configurações", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 27e65b31..d6594cc6 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "П" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Параметры", @@ -274,6 +281,13 @@ "блок. кнопок" ], "desc": "При работе длинное нажатие обеих кнопок блокирует их <О=Отключено, Т=Только турбо, П=Полная блокировка>" + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index a53dcae8..d7d7d5d7 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "P" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Nastavenie", @@ -274,6 +281,13 @@ "tlačidiel" ], "desc": "Zamknutie tlačidiel - dlhé stlačenie oboch naraz počas spájkovania " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 2f7c6a90..1fbde992 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "P" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Nastavitve", @@ -274,6 +281,13 @@ "zaklep gumbov" ], "desc": "Za zaklep med spajkanjem drži oba gumba " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index 9fa61a14..06a98425 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Поставке", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index 43e64b7d..1dbc82a8 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Postavke", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index a3411b75..ea2af8bb 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Lödnings-", @@ -274,6 +281,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index 8c0f3881..cee79539 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -46,6 +46,13 @@ "SettingLockFullChar": "F" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Lehimleme", @@ -292,6 +299,13 @@ "locking" ], "desc": "When soldering, long press on both buttons lock them " + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } \ No newline at end of file diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index bc86fedd..2382245a 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -49,6 +49,13 @@ "SettingLockFullChar": "П" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "Параметри", @@ -274,6 +281,13 @@ "блок. кнопок" ], "desc": "Під час пайки тривале натискання обох кнопок заблокує їх <В=Вимк, Т=Тільки турбо, П=Повне>" + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index a79691e6..2417e771 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -50,6 +50,13 @@ "SettingLockFullChar": "全" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "", @@ -275,6 +282,13 @@ "撳掣鎖定" ], "desc": "喺焊接模式時,同時長撳兩粒掣啓用撳掣鎖定 <無=停用 | 增=只鎖定增熱模式 | 全=鎖定全部>" + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 02c39d66..9142b004 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -50,6 +50,13 @@ "SettingLockFullChar": "全" }, "menuGroups": { + "PowerMenu": { + "text2": [ + "Power", + "settings" + ], + "desc": "Power settings" + }, "SolderingMenu": { "text2": [ "", @@ -275,6 +282,13 @@ "按鍵鎖定" ], "desc": "於焊接模式時,同時長按兩個按鍵啟用按鍵鎖定 <無=停用 | 增=只鎖定增熱模式 | 全=鎖定全部>" + }, + "MinVolCell": { + "text2": [ + "Maximum", + "voltage" + ], + "desc": "Minimum allowed voltage per cell" } } } diff --git a/Translations/translations_def.js b/Translations/translations_def.js index 82cc9ff0..c4f265f6 100644 --- a/Translations/translations_def.js +++ b/Translations/translations_def.js @@ -173,7 +173,8 @@ var def = { "id": "SettingSensitivityHigh", "len": 1 - }, { + }, + { "id": "SettingLockDisableChar", "len": 1, "default": "D" @@ -190,6 +191,10 @@ var def = } ], "menuGroups": [ + { + "id": "PowerMenu", + "maxLen": 11 + }, { "id": "SolderingMenu", "maxLen": 11 @@ -342,10 +347,16 @@ var def = "id": "HallEffSensitivity", "maxLen": 6, "maxLen2": 8 - }, { + }, + { "id": "LockingMode", "maxLen": 6, "maxLen2": 13 + }, + { + "id": "MinVolCell", + "maxLen": 4, + "maxLen2": 9 } ] } diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index 5ada9fd4..c6b5180e 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -150,6 +150,42 @@ const uint8_t disconnectedTipIcon[] = { * */ const uint8_t SettingsMenuIcons[] = { + // Power + // width = 16 + // height = 16 + 0xC0, + 0xB0, + 0x8C, + 0x83, + 0x01, + 0x01, + 0x21, + 0x31, + 0xA9, + 0x65, + 0x03, + 0x42, + 0x62, + 0x52, + 0xCA, + 0x06, + 0x60, + 0x58, + 0x26, + 0x11, + 0x08, + 0xC4, + 0xB2, + 0x4D, + 0x23, + 0x10, + 0x08, + 0x04, + 0x02, + 0x01, + 0x00, + 0x00, + // Soldering // width = 16 // height = 16 diff --git a/source/Core/Inc/Settings.h b/source/Core/Inc/Settings.h index fecc42f4..c71975f7 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -25,6 +25,7 @@ typedef struct { uint16_t SleepTemp; // temp to drop to in sleep uint8_t SleepTime; // minutes timeout to sleep uint8_t minDCVoltageCells; // The voltage we cut out at for under voltage when powered by DC jack + uint8_t minVoltageCells; // Minimum allowed voltage per cell <3S - 3.0V (30)> <4S - 2.4V (24)> <...> (Minimum recommended 2.7V) uint8_t QCIdealVoltage; // Desired QC3.0 voltage (9,12,20V) uint8_t OrientationMode : 2; // Selects between Auto,Right and left handed layouts uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits) diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 53855f35..541a8a49 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -14,7 +14,7 @@ extern const bool HasFahrenheit; extern const char *SettingsShortNames[29][2]; extern const char *SettingsDescriptions[29]; -extern const char *SettingsMenuEntries[4]; +extern const char *SettingsMenuEntries[5]; extern const char *SettingsCalibrationDone; extern const char *SettingsCalibrationWarning; @@ -76,6 +76,7 @@ extern const char *SymbolSeconds; extern const char *SymbolWatts; extern const char *SymbolVolts; extern const char *SymbolDC; +extern const char *SymbolNA; extern const char *SymbolCellCount; extern const char *SymbolVersionNumber; diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index acd17b41..3cdc8296 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -46,7 +46,7 @@ uint8_t lookupVoltageLevel() { if (systemSettings.minDCVoltageCells == 0) return 90; // 9V since iron does not function effectively below this else - return (systemSettings.minDCVoltageCells * 33) + (33 * 2); + return (systemSettings.minDCVoltageCells * systemSettings.minVoltageCells) + (systemSettings.minVoltageCells * 2); } void resetSettings() { memset((void *)&systemSettings, 0, sizeof(systemSettingsType)); @@ -55,6 +55,7 @@ void resetSettings() { // to sleep - default 1 min systemSettings.SolderingTemp = SOLDERING_TEMP; // Default soldering temp is 320.0 C systemSettings.minDCVoltageCells = CUT_OUT_SETTING; // default to no cut-off voltage + systemSettings.minVoltageCells = RECOM_VOL_CELL; // Minimum voltage per cell (Recommended 3.3V (33)) systemSettings.QCIdealVoltage = 0; // Default to 9V for QC3.0 Voltage systemSettings.version = SETTINGSVERSION; // Store the version number to allow for easier upgrades systemSettings.detailedSoldering = DETAILED_SOLDERING; // Detailed soldering screen diff --git a/source/Core/Src/gui.cpp b/source/Core/Src/gui.cpp index 762b9161..3bddfd4f 100644 --- a/source/Core/Src/gui.cpp +++ b/source/Core/Src/gui.cpp @@ -19,6 +19,8 @@ void gui_Menu(const menuitem *menu); #ifdef POW_DC static bool settings_setInputVRange(void); static void settings_displayInputVRange(void); +static bool settings_setInputMinVRange(void); +static void settings_displayInputMinVRange(void); #endif #ifdef POW_QC static bool settings_setQCInputV(void); @@ -73,10 +75,12 @@ static void settings_displayHallEffect(void); static bool settings_setHallEffect(void); #endif // Menu functions -static void settings_displaySolderingMenu(void); -static bool settings_enterSolderingMenu(void); static void settings_displayPowerMenu(void); static bool settings_enterPowerMenu(void); +static void settings_displaySolderingMenu(void); +static bool settings_enterSolderingMenu(void); +static void settings_displayPowerSavingMenu(void); +static bool settings_enterPowerSavingMenu(void); static void settings_displayUIMenu(void); static bool settings_enterUIMenu(void); static void settings_displayAdvancedMenu(void); @@ -84,7 +88,9 @@ static bool settings_enterAdvancedMenu(void); /* * Root Settings Menu * - * Power Source + * Power Menu + * Power Source + * * Soldering * Boost Mode Enabled * Boost Mode Temp @@ -121,26 +127,34 @@ static bool settings_enterAdvancedMenu(void); */ const menuitem rootSettingsMenu[]{ /* - * Power Source + * Power Menu * Soldering Menu * Power Saving Menu * UI Menu * Advanced Menu * Exit */ -#ifdef POW_DC - {(const char *)SettingsDescriptions[0], settings_setInputVRange, settings_displayInputVRange}, /*Voltage input*/ -#endif -#ifdef POW_QC - {(const char *)SettingsDescriptions[19], settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/ -#endif + {(const char *)NULL, settings_enterPowerMenu, settings_displayPowerMenu}, /*Power*/ {(const char *)NULL, settings_enterSolderingMenu, settings_displaySolderingMenu}, /*Soldering*/ - {(const char *)NULL, settings_enterPowerMenu, settings_displayPowerMenu}, /*Sleep Options Menu*/ + {(const char *)NULL, settings_enterPowerSavingMenu, settings_displayPowerSavingMenu}, /*Sleep Options Menu*/ {(const char *)NULL, settings_enterUIMenu, settings_displayUIMenu}, /*UI Menu*/ {(const char *)NULL, settings_enterAdvancedMenu, settings_displayAdvancedMenu}, /*Advanced Menu*/ {NULL, NULL, NULL} // end of menu marker. DO NOT REMOVE }; +const menuitem powerMenu[] = { + /* + * Power Source + */ +#ifdef POW_DC + {(const char *)SettingsDescriptions[0], settings_setInputVRange, settings_displayInputVRange}, /*Voltage input*/ + {(const char *)SettingsDescriptions[28], settings_setInputMinVRange, settings_displayInputMinVRange}, /*Minimum voltage input*/ +#endif +#ifdef POW_QC + {(const char *)SettingsDescriptions[19], settings_setQCInputV, settings_displayQCInputV}, /*Voltage input*/ +#endif + {NULL, NULL, NULL} // end of menu marker. DO NOT REMOVE +}; const menuitem solderingMenu[] = { /* * Boost Mode Enabled @@ -173,7 +187,7 @@ const menuitem UIMenu[] = { {(const char *)SettingsDescriptions[21], settings_setReverseButtonTempChangeEnabled, settings_displayReverseButtonTempChangeEnabled}, /* Reverse Temp change buttons + - */ {NULL, NULL, NULL} // end of menu marker. DO NOT REMOVE }; -const menuitem PowerMenu[] = { +const menuitem PowerSavingMenu[] = { /* * Sleep Temp * Sleep Time @@ -294,7 +308,9 @@ static int userConfirmation(const char *message) { #ifdef POW_DC static bool settings_setInputVRange(void) { systemSettings.minDCVoltageCells = (systemSettings.minDCVoltageCells + 1) % 5; - return systemSettings.minDCVoltageCells == 4; + if (systemSettings.minDCVoltageCells == 1 && systemSettings.minVoltageCells < 30) + systemSettings.minVoltageCells = 30; + return systemSettings.minDCVoltageCells == 5; } static void settings_displayInputVRange(void) { @@ -307,6 +323,27 @@ static void settings_displayInputVRange(void) { OLED::print(SymbolDC); } } + +static bool settings_setInputMinVRange(void) { + systemSettings.minVoltageCells = (systemSettings.minVoltageCells + 1) % 38; + if (systemSettings.minDCVoltageCells == 1 && systemSettings.minVoltageCells < 30) + systemSettings.minVoltageCells = 30; + else if(systemSettings.minVoltageCells < 24) + systemSettings.minVoltageCells = 24; + return systemSettings.minVoltageCells == 38; +} + +static void settings_displayInputMinVRange(void) { + if (systemSettings.minDCVoltageCells) { + printShortDescription(28, 4); + OLED::printNumber(systemSettings.minVoltageCells / 10, 2); + OLED::print(SymbolDot); + OLED::printNumber(systemSettings.minVoltageCells % 10, 1); + } else { + printShortDescription(28, 5); + OLED::print(SymbolNA); + } +} #endif #ifdef POW_QC static bool settings_setQCInputV(void) { @@ -904,22 +941,27 @@ static void displayMenu(size_t index) { } static void settings_displayCalibrateVIN(void) { printShortDescription(13, 5); } -static void settings_displaySolderingMenu(void) { displayMenu(0); } +static void settings_displayPowerMenu(void) { displayMenu(0); } +static bool settings_enterPowerMenu(void) { + gui_Menu(powerMenu); + return false; +} +static void settings_displaySolderingMenu(void) { displayMenu(1); } static bool settings_enterSolderingMenu(void) { gui_Menu(solderingMenu); return false; } -static void settings_displayPowerMenu(void) { displayMenu(1); } -static bool settings_enterPowerMenu(void) { - gui_Menu(PowerMenu); +static void settings_displayPowerSavingMenu(void) { displayMenu(2); } +static bool settings_enterPowerSavingMenu(void) { + gui_Menu(PowerSavingMenu); return false; } -static void settings_displayUIMenu(void) { displayMenu(2); } +static void settings_displayUIMenu(void) { displayMenu(3); } static bool settings_enterUIMenu(void) { gui_Menu(HasFahrenheit ? UIMenu : UIMenu + 1); return false; } -static void settings_displayAdvancedMenu(void) { displayMenu(3); } +static void settings_displayAdvancedMenu(void) { displayMenu(4); } static bool settings_enterAdvancedMenu(void) { gui_Menu(advancedMenu); return false; diff --git a/source/configuration.h b/source/configuration.h index 6ae7d372..a326dfc8 100644 --- a/source/configuration.h +++ b/source/configuration.h @@ -88,9 +88,10 @@ #define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0 #define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0 -#define CUT_OUT_SETTING 0 // default to no cut-off voltage -#define TEMPERATURE_INF 0 // default to 0 -#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow +#define CUT_OUT_SETTING 0 // default to no cut-off voltage +#define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33)) +#define TEMPERATURE_INF 0 // default to 0 +#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow #define OP_AMP_Rf_TS100 750 * 1000 // 750 Kilo-ohms -> From schematic, R1 #define OP_AMP_Rin_TS100 2370 // 2.37 Kilo-ohms -> From schematic, R2