From 1fb84d5f50553b70df3586acee9f13caf8fca629 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 26 Jan 2025 05:03:46 +0200 Subject: [PATCH] Implemented switching A and B buttons, closing #2034 getButtonState() now have an option int/bool argument to swap the result via XOR --- Translations/translation_BE.json | 6 +- Translations/translation_BG.json | 4 ++ Translations/translation_CS.json | 4 ++ Translations/translation_DA.json | 4 ++ Translations/translation_DE.json | 4 ++ Translations/translation_EL.json | 4 ++ Translations/translation_EN.json | 6 +- Translations/translation_ES.json | 4 ++ Translations/translation_ET.json | 4 ++ Translations/translation_FI.json | 4 ++ Translations/translation_FR.json | 6 +- Translations/translation_HR.json | 4 ++ Translations/translation_HU.json | 4 ++ Translations/translation_IT.json | 6 +- Translations/translation_JA_JP.json | 4 ++ Translations/translation_LT.json | 4 ++ Translations/translation_NB.json | 4 ++ Translations/translation_NL.json | 4 ++ Translations/translation_NL_BE.json | 4 ++ Translations/translation_PL.json | 6 +- Translations/translation_PT.json | 6 +- Translations/translation_RO.json | 6 +- Translations/translation_RU.json | 4 ++ Translations/translation_SK.json | 4 ++ Translations/translation_SL.json | 4 ++ Translations/translation_SR_CYRL.json | 4 ++ Translations/translation_SR_LATN.json | 4 ++ Translations/translation_SV.json | 4 ++ Translations/translation_TR.json | 4 ++ Translations/translation_UK.json | 8 ++- Translations/translation_UZ.json | 4 ++ Translations/translation_VI.json | 4 ++ Translations/translation_YUE_HK.json | 4 ++ Translations/translation_ZH_CN.json | 4 ++ Translations/translation_ZH_TW.json | 4 ++ Translations/translations_definitions.json | 6 ++ source/Core/BSP/MHP30/configuration.h | 3 +- source/Core/BSP/Miniware/configuration.h | 3 +- source/Core/BSP/Pinecil/configuration.h | 3 +- source/Core/BSP/Pinecilv2/configuration.h | 3 +- source/Core/BSP/Sequre/configuration.h | 3 +- source/Core/Drivers/Buttons.cpp | 6 +- source/Core/Drivers/Buttons.hpp | 2 +- source/Core/Inc/Settings.h | 61 ++++++++++--------- source/Core/Inc/Translation.h | 1 + source/Core/Src/Settings.cpp | 2 + source/Core/Src/settingsGUI.cpp | 8 ++- source/Core/Threads/GUIThread.cpp | 2 +- .../Threads/UI/logic/TemperatureAdjust.cpp | 2 +- .../UI/logic/utils/shouldDeviceShutdown.cpp | 2 +- 50 files changed, 212 insertions(+), 53 deletions(-) diff --git a/Translations/translation_BE.json b/Translations/translation_BE.json index 42b16c02..c71bdff0 100644 --- a/Translations/translation_BE.json +++ b/Translations/translation_BE.json @@ -272,8 +272,12 @@ "description": "Хуткасць гартання тэксту (М=марудна | Х=хутка)" }, "ReverseButtonTempChange": { - "displayText": "Інвертаваць\nкнопкі", + "displayText": "Інвертаваць\nкнопкі +/-", "description": "Інвертаваць кнопкі вымярэння тэмпературы" + }, + "ReverseButtonNav": { + "displayText": "Інвертаваць\nкнопкі A/B", + "description": "Інвертаваць кнопкі навігацыі ў меню" }, "AnimSpeed": { "displayText": "Хуткасць\nанімацыі", diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index bfe61bc6..6ceac453 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Размяна\nбутони +/-", "description": "Обръщане на бутоните + и - за промяна на температурата на човка на поялника" + }, + "ReverseButtonNav": { + "displayText": "Размяна\nбутони А/В", + "description": "Обръщане бутоните А и В за навигация в менютата" }, "AnimSpeed": { "displayText": "Скорост на\nанимацията", diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index a6ea50e5..ea9975ed 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Prohodit\ntl. +-?", "description": "Prohodit tlačítka pro změnu teploty" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nrychlost", diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index c80e7c6f..2ac79681 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Skift\n+ - tasterne", "description": "Skift tildeling af knapper til temperaturjustering" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nHastighed", diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index 0208a848..78974c23 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "+- Tasten\numkehren", "description": "Tastenbelegung zur Temperaturänderung umkehren" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nGeschw.", diff --git a/Translations/translation_EL.json b/Translations/translation_EL.json index 8a8a99ea..5406de61 100644 --- a/Translations/translation_EL.json +++ b/Translations/translation_EL.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Αντιστροφή\nπλήκτρων + -", "description": "Αντιστροφή διάταξης πλήκτρων στη ρύθμιση θερμοκρασίας" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Ταχύτητα\nκιν. εικονιδ.", diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index 9ef29e1e..0bbf00be 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -272,8 +272,12 @@ "description": "Scrolling speed of info text (S=slow | F=fast)" }, "ReverseButtonTempChange": { - "displayText": "Swap\n+ - keys", + "displayText": "Swap\n+/- keys", "description": "Reverse assignment of buttons for temperature adjustment" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nspeed", diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index 76d8fd4d..1ec5c8c1 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Invertir\nbotones +/-", "description": "Invertir botones de ajuste de temperatura" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nvelocidad", diff --git a/Translations/translation_ET.json b/Translations/translation_ET.json index 75dcccf3..49ca8520 100644 --- a/Translations/translation_ET.json +++ b/Translations/translation_ET.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Vaheta\n+ - nupud", "description": "Temperatuurinuppude asukohtade vahetus" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nkiirus", diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index b9c04ead..b1b59b31 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Suunnanvaihto\n+ - näppäimille", "description": "Lämpötilapainikkeiden suunnan vaihtaminen" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Animaation\nnopeus", diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index 07f404f8..da91c46c 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -272,8 +272,12 @@ "description": "Vitesse de défilement du texte (R=rapide | L=lent)" }, "ReverseButtonTempChange": { - "displayText": "Inverser les\ntouches + -", + "displayText": "Inverser les\ntouches +/-", "description": "Inverser les boutons d'ajustement de température" + }, + "ReverseButtonNav": { + "displayText": "Inverser les\ntouches A/B", + "description": "Inverser les boutons de navigation du menu" }, "AnimSpeed": { "displayText": "Vitesse\nanim. icônes", diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index 53455e5f..3de59a75 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Zamjena\n+ - tipki", "description": "Zamjenjuje funkciju gornje i donje tipke za podešavanje temperature" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Brzina\nanimacije", diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index db817202..5202a316 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "+/- gomb\nmegfordítása", "description": "Forrasztó hegy hőmérsékletállító gombok felcserélése" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Animáció\nsebessége", diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index 643a9f53..74b2cf5b 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -272,8 +272,12 @@ "description": "Imposta la velocità di scorrimento del testo [L: lenta; V: veloce]" }, "ReverseButtonTempChange": { - "displayText": "Inversione\ntasti", + "displayText": "Inversione\ntasti +/-", "description": "Inverti i tasti per aumentare o diminuire la temperatura della punta" + }, + "ReverseButtonNav": { + "displayText": "Inversione\ntasti A/B", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Velocità\nanimazioni", diff --git a/Translations/translation_JA_JP.json b/Translations/translation_JA_JP.json index 58fe176b..31f71254 100644 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "キー入れ替え", "description": "温度設定時に+ボタンと-ボタンを入れ替える" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "動画の速度", diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index 2d77dec8..0a0d941f 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Sukeisti + -\nmygtukus?", "description": "Sukeisti + - temperatūros keitimo mygtukus vietomis" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Animacijų\ngreitis", diff --git a/Translations/translation_NB.json b/Translations/translation_NB.json index cac1f307..92bd70b2 100644 --- a/Translations/translation_NB.json +++ b/Translations/translation_NB.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Bytt\n+ - kn.", "description": "Bytt om på knappene for å stille temperatur" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nhastighet", diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index 7b3a68d8..814c9e6e 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Wissel\n+ - knoppen", "description": "Wissel de knoppen voor temperatuur controle om" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nsnelheid", diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index 989359df..22825e10 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Wissel\n+ - knoppen", "description": "Wissel de knoppen voor temperatuur controle" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nsnelheid", diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index 8e516076..a7e20a4d 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -272,8 +272,12 @@ "description": "Szybkość przewijania tekstu" }, "ReverseButtonTempChange": { - "displayText": "Zamień przyc.\n+ -", + "displayText": "Zamień przyc.\n+/-", "description": "Zamienia działanie przycisków zmiany temperatury grotu" + }, + "ReverseButtonNav": { + "displayText": "Zamień przyc.\nA/B", + "description": "Zamienia działanie przycisków nawigacyjne menu" }, "AnimSpeed": { "displayText": "Prędkosć\nanimacji", diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index 5f4ab999..5eab3bf2 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -272,8 +272,12 @@ "description": "Velocidade a que o texto de ajuda é apresentado" }, "ReverseButtonTempChange": { - "displayText": "Trocar\nbotões + -", + "displayText": "Trocar\nbotões +/-", "description": "Inverte o funcionamento dos botões de ajuste da temperatura" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Velocidade\nde animação", diff --git a/Translations/translation_RO.json b/Translations/translation_RO.json index 2e5105fa..ead244d5 100644 --- a/Translations/translation_RO.json +++ b/Translations/translation_RO.json @@ -272,8 +272,12 @@ "description": "Viteză derulare text cu informatii la (S=lent | F=rapid)" }, "ReverseButtonTempChange": { - "displayText": "Inversare\n+ - butoane", + "displayText": "Inversare\n+/- butoane", "description": "Inversarea butoanelor de reglare a temperaturii" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Animaţii\nviteză", diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 81dac2ef..1a56c649 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Поменять\nкнопки +/-", "description": "Поменять кнопки изменения температуры" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Скорость\nанимации", diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index 476b8288..9f8cbb30 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Otočenie\ntlačidiel +/-", "description": "Prehodenie tlačidiel na nastavovanie teploty" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Rýchlosť\nanimácií", diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 358f9117..d2b6886c 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Obrni\ntipki + -?", "description": "Zamenjaj funkciji gumbov." + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nspeed", diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index 70ddae54..caf5dc59 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Swap\n+ - keys", "description": "Reverse assignment of buttons for temperature adjustment" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nspeed", diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index eaa70d80..41759008 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Swap\n+ - keys", "description": "Reverse assignment of buttons for temperature adjustment" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\nspeed", diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index 3cdaf691..0ee5dc31 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Omvända\n+- knappar", "description": "Omvänd ordning för temperaturjustering via plus/minus knapparna" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.-\nhastighet", diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index 539ffa44..5e5a62fe 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Düğme Yerleri\nRotasyonu", "description": "\"Düğme Yerleri Rotasyonu\" Sıcaklık ayar düğmelerinin yerini değiştirin" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Animasyon\nHızı", diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index 0c44e861..819b76d1 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -97,7 +97,7 @@ "description": "" }, "UIMenu": { - "displayText": "Параметри\nінтерфейсу", + "displayText": "Параметри\nвзаємодії", "description": "" }, "AdvancedMenu": { @@ -276,7 +276,11 @@ "description": "Обернути кнопки зміни t°" }, "ReverseButtonNav": { - "displayText": "Обернути\nкнопки AB?", + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" + }, + "ReverseButtonNav": { + "displayText": "Обернути\nкнопки A B?", "description": "Обернути кнопки навігації" }, "AnimSpeed": { diff --git a/Translations/translation_UZ.json b/Translations/translation_UZ.json index 97f8b9d6..f921c550 100644 --- a/Translations/translation_UZ.json +++ b/Translations/translation_UZ.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "(+) va (-) tugmalarni\nalmashtirish", "description": "Harorat o'zgarishi uchun tugmachalarni vazifasini almashish" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Anim.\ntezligi", diff --git a/Translations/translation_VI.json b/Translations/translation_VI.json index dae1a653..471bf4c7 100644 --- a/Translations/translation_VI.json +++ b/Translations/translation_VI.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "Đao nguoc\nnút + -", "description": "Đao nguoc chuc năng các nút đieu chinh nhiet đo" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "Toc đo\nhoat anh", diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index e7737b2b..86d96a05 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "反轉加減掣", "description": "反轉調校温度時加減掣嘅方向" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "動畫速度", diff --git a/Translations/translation_ZH_CN.json b/Translations/translation_ZH_CN.json index 68561281..0638dfab 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "调换加减键", "description": "调校温度时更换加减键的方向" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "动画速度", diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 22218051..bc91711a 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -274,6 +274,10 @@ "ReverseButtonTempChange": { "displayText": "調換加減鍵", "description": "調校溫度時調換加減鍵的方向" + }, + "ReverseButtonNav": { + "displayText": "Swap\nA/B keys", + "description": "Reverse assignment of buttons for menu navigation" }, "AnimSpeed": { "displayText": "動畫速度", diff --git a/Translations/translations_definitions.json b/Translations/translations_definitions.json index e473ca34..ebf4f6c3 100644 --- a/Translations/translations_definitions.json +++ b/Translations/translations_definitions.json @@ -472,6 +472,12 @@ "maxLen": 6, "maxLen2": 15, "description": "Swaps which button increments and decrements on temperature change screens." + }, + { + "id": "ReverseButtonNav", + "maxLen": 6, + "maxLen2": 15, + "description": "Swaps which button are used as Select and which as Scroll/Go-back on menu screens." }, { "id": "AnimSpeed", diff --git a/source/Core/BSP/MHP30/configuration.h b/source/Core/BSP/MHP30/configuration.h index 8698a857..0d7369ff 100644 --- a/source/Core/BSP/MHP30/configuration.h +++ b/source/Core/BSP/MHP30/configuration.h @@ -57,7 +57,8 @@ */ #define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right #define MAX_ORIENTATION_MODE 1 // Unlikely to ever change -#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change +#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_NAV 0 // 0:Default 1:Reverse - Reverse the A and B button assignment in the menus /** * OLED Brightness diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index 6aebed15..4015a48b 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -57,7 +57,8 @@ */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto -#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change +#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_NAV 0 // 0:Default 1:Reverse - Reverse the A and B button assignment in the menus /** * OLED Brightness diff --git a/source/Core/BSP/Pinecil/configuration.h b/source/Core/BSP/Pinecil/configuration.h index bef59a93..f0cca67a 100644 --- a/source/Core/BSP/Pinecil/configuration.h +++ b/source/Core/BSP/Pinecil/configuration.h @@ -57,7 +57,8 @@ */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto -#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change +#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_NAV 0 // 0:Default 1:Reverse - Reverse the A and B button assignment in the menus /** * OLED Brightness diff --git a/source/Core/BSP/Pinecilv2/configuration.h b/source/Core/BSP/Pinecilv2/configuration.h index 0f21f138..e789e1e9 100644 --- a/source/Core/BSP/Pinecilv2/configuration.h +++ b/source/Core/BSP/Pinecilv2/configuration.h @@ -57,7 +57,8 @@ */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto -#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change +#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_NAV 0 // 0:Default 1:Reverse - Reverse the A and B button assignment in the menus /** * OLED Brightness diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index df06f68e..a6de0847 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -66,7 +66,8 @@ */ #define ORIENTATION_MODE 0 // 0: Right 1:Left (2:Automatic N/A) #define MAX_ORIENTATION_MODE 1 // Disable auto mode -#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change +#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_NAV 0 // 0:Default 1:Reverse - Reverse the A and B button assignment in the menus /** * Temp change settings diff --git a/source/Core/Drivers/Buttons.cpp b/source/Core/Drivers/Buttons.cpp index 82637427..8e08d47f 100644 --- a/source/Core/Drivers/Buttons.cpp +++ b/source/Core/Drivers/Buttons.cpp @@ -11,7 +11,7 @@ #include TickType_t lastButtonTime = 0; -ButtonState getButtonState() { +ButtonState getButtonState(bool revert) { /* * Read in the buttons and then determine if a state change needs to occur */ @@ -28,8 +28,8 @@ ButtonState getButtonState() { static TickType_t previousStateChange = 0; const TickType_t timeout = TICKS_100MS * 4; uint8_t currentState; - currentState = (getButtonA()) << 0; - currentState |= (getButtonB()) << 1; + currentState = (getButtonA()) << (0 xor revert); + currentState |= (getButtonB()) << (1 xor revert); if (currentState) { lastButtonTime = xTaskGetTickCount(); diff --git a/source/Core/Drivers/Buttons.hpp b/source/Core/Drivers/Buttons.hpp index 2e421118..e85d7112 100644 --- a/source/Core/Drivers/Buttons.hpp +++ b/source/Core/Drivers/Buttons.hpp @@ -27,7 +27,7 @@ enum ButtonState { }; // Returns what buttons are pressed (if any) -ButtonState getButtonState(); +ButtonState getButtonState(bool revert=0); // Helpers void waitForButtonPressOrTimeout(TickType_t timeout); void waitForButtonPress(); diff --git a/source/Core/Inc/Settings.h b/source/Core/Inc/Settings.h index fd41e271..2366b772 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -47,37 +47,38 @@ enum SettingsOptions { CalibrationOffset = 23, // This stores the temperature offset for this tip in the iron. PowerLimit = 24, // Maximum power iron allowed to output ReverseButtonTempChangeEnabled = 25, // Change the plus and minus button assigment - TempChangeLongStep = 26, // Temperature-change-increment on long button press - TempChangeShortStep = 27, // Temperature-change-increment on short button press - HallEffectSensitivity = 28, // Operating mode of the hall effect sensor - AccelMissingWarningCounter = 29, // Counter of how many times we have warned we cannot detect the accelerometer - PDMissingWarningCounter = 30, // Counter of how many times we have warned we cannot detect the pd interface - UILanguage = 31, // Selected UI Language code, null-terminated *only if* the length is less than 8 chars - PDNegTimeout = 32, // PD timeout in 100ms steps - OLEDInversion = 33, // Invert the colours on the display - OLEDBrightness = 34, // Brightness for the OLED display - LOGOTime = 35, // Duration the logo will be displayed for - CalibrateCJC = 36, // Toggle calibrate CJC at next boot - BluetoothLE = 37, // Toggle BLE if present - 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 - ProfilePhase1Temp = 42, // Temperature to target for the end of phase 1 - ProfilePhase1Duration = 43, // Target duration for phase 1 - ProfilePhase2Temp = 44, // Temperature to target for the end of phase 2 - ProfilePhase2Duration = 45, // Target duration for phase 2 - ProfilePhase3Temp = 46, // Temperature to target for the end of phase 3 - ProfilePhase3Duration = 47, // Target duration for phase 3 - ProfilePhase4Temp = 48, // Temperature to target for the end of phase 4 - ProfilePhase4Duration = 49, // Target duration for phase 4 - ProfilePhase5Temp = 50, // Temperature to target for the end of phase 5 - ProfilePhase5Duration = 51, // Target duration for phase 5 - ProfileCooldownSpeed = 52, // Maximum allowed cooldown speed in degrees per second - HallEffectSleepTime = 53, // Seconds (/5) timeout to sleep when hall effect over threshold - SolderingTipType = 54, // Selecting the type of soldering tip fitted + ReverseButtonNavEnabled = 26, // Change the A and B button assigment in menus + TempChangeLongStep = 27, // Temperature-change-increment on long button press + TempChangeShortStep = 28, // Temperature-change-increment on short button press + HallEffectSensitivity = 29, // Operating mode of the hall effect sensor + AccelMissingWarningCounter = 30, // Counter of how many times we have warned we cannot detect the accelerometer + PDMissingWarningCounter = 31, // Counter of how many times we have warned we cannot detect the pd interface + UILanguage = 32, // Selected UI Language code, null-terminated *only if* the length is less than 8 chars + PDNegTimeout = 33, // PD timeout in 100ms steps + OLEDInversion = 34, // Invert the colours on the display + OLEDBrightness = 35, // Brightness for the OLED display + LOGOTime = 36, // Duration the logo will be displayed for + CalibrateCJC = 37, // Toggle calibrate CJC at next boot + BluetoothLE = 38, // Toggle BLE if present + USBPDMode = 39, // Toggle PPS & EPR + ProfilePhases = 40, // Number of profile mode phases + ProfilePreheatTemp = 41, // Temperature to preheat to before the first phase + ProfilePreheatSpeed = 42, // Maximum allowed preheat speed in degrees per second + ProfilePhase1Temp = 43, // Temperature to target for the end of phase 1 + ProfilePhase1Duration = 44, // Target duration for phase 1 + ProfilePhase2Temp = 45, // Temperature to target for the end of phase 2 + ProfilePhase2Duration = 46, // Target duration for phase 2 + ProfilePhase3Temp = 47, // Temperature to target for the end of phase 3 + ProfilePhase3Duration = 48, // Target duration for phase 3 + ProfilePhase4Temp = 49, // Temperature to target for the end of phase 4 + ProfilePhase4Duration = 50, // Target duration for phase 4 + ProfilePhase5Temp = 51, // Temperature to target for the end of phase 5 + ProfilePhase5Duration = 52, // Target duration for phase 5 + ProfileCooldownSpeed = 53, // Maximum allowed cooldown speed in degrees per second + HallEffectSleepTime = 54, // Seconds (/5) timeout to sleep when hall effect over threshold + SolderingTipType = 55, // Selecting the type of soldering tip fitted // - SettingsOptionsLength = 55, // End marker + SettingsOptionsLength = 56, // End marker }; typedef enum { diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index c8ad9019..bc95bbed 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -90,6 +90,7 @@ enum class SettingsItemIndex : uint8_t { CooldownBlink, ScrollingSpeed, ReverseButtonTempChange, + ReverseButtonNav, AnimSpeed, AnimLoop, Brightness, diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 28198f78..3fb62022 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -81,6 +81,8 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp {MIN_CALIBRATION_OFFSET, 2500, 1, CALIBRATION_OFFSET}, // CalibrationOffset { 0, MAX_POWER_LIMIT, POWER_LIMIT_STEPS, POWER_LIMIT}, // PowerLimit { 0, 1, 1, REVERSE_BUTTON_TEMP_CHANGE}, // ReverseButtonTempChangeEnabled + { 0, 1, 1, + REVERSE_BUTTON_NAV}, // ReverseButtonNavEnabled { 5, TEMP_CHANGE_LONG_STEP_MAX, 5, TEMP_CHANGE_LONG_STEP}, // TempChangeLongStep { 1, TEMP_CHANGE_SHORT_STEP_MAX, 1, TEMP_CHANGE_SHORT_STEP}, // TempChangeShortStep { 0, 9, 1, 7}, // HallEffectSensitivity diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index d26b26bb..0a30f9b6 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -47,6 +47,7 @@ static void displayAdvancedSolderingScreens(void); static void displayAdvancedIDLEScreens(void); static void displayScrollSpeed(void); static void displayReverseButtonTempChangeEnabled(void); +static void displayReverseButtonNavEnabled(void); static void displayPowerLimit(void); #ifdef BLE_ENABLED @@ -395,6 +396,8 @@ const menuitem UIMenu[] = { {SETTINGS_DESC(SettingsItemIndex::ScrollingSpeed), nullptr, displayScrollSpeed, nullptr, SettingsOptions::DescriptionScrollSpeed, SettingsItemIndex::ScrollingSpeed, 7}, /* Reverse Temp change buttons +/- */ {SETTINGS_DESC(SettingsItemIndex::ReverseButtonTempChange), nullptr, displayReverseButtonTempChangeEnabled, nullptr, SettingsOptions::ReverseButtonTempChangeEnabled, SettingsItemIndex::ReverseButtonTempChange, 7}, + /* Reverse menu nav buttons A/B */ + {SETTINGS_DESC(SettingsItemIndex::ReverseButtonNav), nullptr, displayReverseButtonNavEnabled, nullptr, SettingsOptions::ReverseButtonNavEnabled, SettingsItemIndex::ReverseButtonNav, 7}, /* Animation Speed adjustment */ {SETTINGS_DESC(SettingsItemIndex::AnimSpeed), nullptr, displayAnimationSpeed, nullptr, SettingsOptions::AnimationSpeed, SettingsItemIndex::AnimSpeed, 7}, /* Animation Loop switch */ @@ -480,7 +483,7 @@ static int userConfirmation(const char *message) { for (;;) { drawScrollingText(message, xTaskGetTickCount() - tickStart); - ButtonState buttons = getButtonState(); + ButtonState buttons = getButtonState(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)); switch (buttons) { case BUTTON_F_SHORT: // User confirmed @@ -856,6 +859,7 @@ static void displayCoolingBlinkEnabled(void) { OLED::drawCheckbox(getSettingValu static void displayScrollSpeed(void) { OLED::print(translatedString((getSettingValue(SettingsOptions::DescriptionScrollSpeed)) ? Tr->SettingFastChar : Tr->SettingSlowChar), FontStyle::LARGE); } static void displayReverseButtonTempChangeEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)); } +static void displayReverseButtonNavEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonNavEnabled)); } static void displayAnimationSpeed(void) { switch (getSettingValue(SettingsOptions::AnimationSpeed)) { @@ -952,7 +956,7 @@ static void setCalibrateVIN(void) { OLED::setCursor(0, 8); OLED::printNumber(getSettingValue(SettingsOptions::VoltageDiv), 3, FontStyle::SMALL); - switch (getButtonState()) { + switch (getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled))) { case BUTTON_F_SHORT: prevSettingValue(SettingsOptions::VoltageDiv); break; diff --git a/source/Core/Threads/GUIThread.cpp b/source/Core/Threads/GUIThread.cpp index e60a50ef..a6bcac80 100644 --- a/source/Core/Threads/GUIThread.cpp +++ b/source/Core/Threads/GUIThread.cpp @@ -44,7 +44,7 @@ OperatingMode handle_post_init_state(); OperatingMode guiHandleDraw(void) { OLED::clearScreen(); // Clear ready for render pass // Read button state - ButtonState buttons = getButtonState(); + ButtonState buttons = getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled)); // Enforce screen on if buttons pressed, movement, hot tip etc if (buttons != BUTTON_NONE) { OLED::setDisplayState(OLED::DisplayState::ON); diff --git a/source/Core/Threads/UI/logic/TemperatureAdjust.cpp b/source/Core/Threads/UI/logic/TemperatureAdjust.cpp index 34a896c3..4a8b76e3 100644 --- a/source/Core/Threads/UI/logic/TemperatureAdjust.cpp +++ b/source/Core/Threads/UI/logic/TemperatureAdjust.cpp @@ -55,7 +55,7 @@ OperatingMode gui_solderingTempAdjust(const ButtonState buttonIn, guiContext *cx (*autoRepeatAcceleration) = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN; } // If buttons are flipped; flip the delta - if (getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)) { + if (getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) xor getSettingValue(SettingsOptions::ReverseButtonNavEnabled)) { delta = -delta; } if (delta != 0) { diff --git a/source/Core/Threads/UI/logic/utils/shouldDeviceShutdown.cpp b/source/Core/Threads/UI/logic/utils/shouldDeviceShutdown.cpp index 541a2669..d050a3ce 100644 --- a/source/Core/Threads/UI/logic/utils/shouldDeviceShutdown.cpp +++ b/source/Core/Threads/UI/logic/utils/shouldDeviceShutdown.cpp @@ -17,7 +17,7 @@ bool shouldShutdown(void) { } } } - if (getButtonState() == BUTTON_B_LONG) { // allow also if back button is pressed long + if (getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled)) == BUTTON_B_LONG) { // allow also if back button is pressed long return true; } return false;