diff --git a/.github/workflows/weblate.yml b/.github/workflows/weblate.yml index 885e7a6f..905850dc 100644 --- a/.github/workflows/weblate.yml +++ b/.github/workflows/weblate.yml @@ -21,5 +21,5 @@ jobs: _Translations from [Weblate](https://hosted.weblate.org/projects/ironos/main-firmware/)_ pr_reviewer: "ralim" - pr_draft: false + pr_draft: true github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Translations/translation_BE.json b/Translations/translation_BE.json index 4ad19b1f..07d9667e 100644 --- a/Translations/translation_BE.json +++ b/Translations/translation_BE.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Мова:\n BY Беларуская", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index 2c9c4069..6eac3ef8 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Език:\n BG Български", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index 21562492..40691ea1 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jazyk:\n CS Český", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index 50908921..0e8e68bc 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Sprog:\n DA Dansk", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index e69b7a85..86c2c6c8 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Sprache:\n DE Deutsch", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_EL.json b/Translations/translation_EL.json index c58ef08d..e53e7e44 100644 --- a/Translations/translation_EL.json +++ b/Translations/translation_EL.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Γλώσσα:\n GR Ελληνικά", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index ba1806be..0917d3c9 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Language:\n EN English", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } -} \ No newline at end of file +} diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index fcb00576..fd859c65 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -1,7 +1,7 @@ { "languageCode": "ES", "languageLocalName": "Castellano", - "tempUnitFahrenheit": false, + "tempUnitFahrenheit": true, "messagesWarn": { "CJCCalibrationDone": { "message": "Calibration\ndone!" @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Idioma:\n ES Castellano", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } -} \ No newline at end of file +} diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index e1d7c290..0e497f98 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Kieli:\n FI Suomi", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index 2823ada0..ab0ea2a7 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Langue:\n FR Français", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index 4ec4f8b9..81d7fdbd 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jezik:\n HR Hrvatski", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index 713b4e22..57741606 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Nyelv:\n HU Magyar", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index 03914695..da02a9e4 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -31,13 +31,13 @@ "message": "Temperatura\nfuori controllo" }, "SettingsCalibrationWarning": { - "message": "Prima di riavviare assicurati che punta e impugnatura siano a temperatura ambiente!" + "message": "Prima di riavviare assicurati che la punta e l'impugnatura siano a temperatura ambiente!" }, "CJCCalibrating": { "message": "Calibrazione in corso" }, "SettingsResetWarning": { - "message": "Ripristinare le impostazioni di default?" + "message": "Ripristinare le impostazioni predefinite?" }, "UVLOWarningString": { "message": "DC BASSA" @@ -113,7 +113,7 @@ }, "QCMaxVoltage": { "displayText": "Tensione\nQC", - "description": "Imposta la tensione massima negoziabile con un alimentatore Quick Charge [volt]" + "description": "Imposta la massima tensione negoziabile con un alimentatore Quick Charge [volt]" }, "PDNegTimeout": { "displayText": "Abilitazione\nUSB PD", @@ -233,11 +233,15 @@ }, "SettingsReset": { "displayText": "Ripristino\nimpostazioni", - "description": "Ripristina le impostazioni di default" + "description": "Ripristina le impostazioni predefinite" }, "LanguageSwitch": { "displayText": "Lingua:\n IT Italiano", "description": "" + }, + "BLEEnabled": { + "displayText": "Bluetooth LE\nabilitato", + "description": "" } } -} \ No newline at end of file +} diff --git a/Translations/translation_JA_JP.json b/Translations/translation_JA_JP.json index c270fc25..ae918ce9 100755 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "言語: 日本語", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index 2fdff25c..939ce266 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Kalba:\n LT Lietuvių", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_NB.json b/Translations/translation_NB.json index 2a866f75..ed000e45 100644 --- a/Translations/translation_NB.json +++ b/Translations/translation_NB.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Språk:\n NB Norsk bm", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index 57f2290d..e6c8ae33 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Taal:\n NL Nederlands", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index ed5b1a39..a61b223a 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Spraak:\n NL_BE Vlaams", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index fa0c19ba..215da5c3 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Język:\n PL Polski", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index d1623a40..3527add4 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Idioma:\n PT Português", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_RO.json b/Translations/translation_RO.json index 8c301709..b2c7f60b 100644 --- a/Translations/translation_RO.json +++ b/Translations/translation_RO.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Limbă:\n RO Română", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 7803d5c4..3b5bc586 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Язык:\n RU Русский", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index 939b435f..45ae0e82 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jazyk:\n SK Slovenčina", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 9f6e9438..143274e4 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jezik:\n SL Slovenščina", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index 83f19e5b..8e1c44b1 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jезик:\n SR Српски", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index 2e47c283..4b6fb7a9 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Jezik:\n SR Srpski", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index 0a3a67dc..98451dca 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Språk:\n SV Svenska", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index 3de1e8c4..2dc5e345 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Dil:\n TR Türkçe", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index d1debc26..6a667262 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Мова:\n UK Українська", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_VI.json b/Translations/translation_VI.json index 77971205..b8c1a3a3 100644 --- a/Translations/translation_VI.json +++ b/Translations/translation_VI.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "Ngôn ngu:\n VI Tieng Viet", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index 17d20c0d..0ac2650f 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "語言: 廣東話", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_ZH_CN.json b/Translations/translation_ZH_CN.json index 61cae6de..49f1693e 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "语言:简体中文", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 93e0c3d3..50cc70cc 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -238,6 +238,10 @@ "LanguageSwitch": { "displayText": "語言:正體中文", "description": "" + }, + "BLEEnabled": { + "displayText": "BLE\n Enabled", + "description": "" } } } \ No newline at end of file diff --git a/Translations/translations_definitions.json b/Translations/translations_definitions.json index 45aa87d7..3e562191 100644 --- a/Translations/translations_definitions.json +++ b/Translations/translations_definitions.json @@ -396,6 +396,12 @@ "maxLen": 7, "maxLen2": 15, "description": "Changes the device language on multi-lingual builds." + }, + { + "id": "BLEEnabled", + "maxLen": 7, + "maxLen2": 15, + "description": "Should BLE be enabled at boot time." } ] -} +} \ No newline at end of file diff --git a/source/Core/BSP/Pinecilv2/configuration.h b/source/Core/BSP/Pinecilv2/configuration.h index 06871af8..5ac45874 100644 --- a/source/Core/BSP/Pinecilv2/configuration.h +++ b/source/Core/BSP/Pinecilv2/configuration.h @@ -152,7 +152,7 @@ #define HAS_POWER_DEBUG_MENU #define HARDWARE_MAX_WATTAGE_X10 750 #define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second - +#define BLE_ENABLED #define NEEDS_VBUS_PROBE 0 #endif diff --git a/source/Core/BSP/Pinecilv2/postRTOS.cpp b/source/Core/BSP/Pinecilv2/postRTOS.cpp index dbd7a433..4b705be6 100644 --- a/source/Core/BSP/Pinecilv2/postRTOS.cpp +++ b/source/Core/BSP/Pinecilv2/postRTOS.cpp @@ -19,7 +19,10 @@ void postRToSInit() { hall_effect_present = Si7210::init(); } #endif - ble_stack_start(); + + if (getSettingValue(SettingsOptions::BLEEnabled)) { + ble_stack_start(); + } } int16_t getRawHallEffect() { if (hall_effect_present) { diff --git a/source/Core/Inc/Settings.h b/source/Core/Inc/Settings.h index a1435650..df0d2cf4 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -51,9 +51,10 @@ enum SettingsOptions { OLEDBrightness = 34, // Brightness for the OLED display LOGOTime = 35, // Duration the logo will be displayed for CalibrateCJC = 36, // Toggle calibrate CJC at next boot + BLEEnabled = 37, // Should BLE hardware be enabled if present // - SettingsOptionsLength = 37, // + SettingsOptionsLength = 38, // }; typedef enum { diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index ccb76b7c..4f9c3861 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -85,6 +85,7 @@ enum class SettingsItemIndex : uint8_t { PowerPulseDuration, SettingsReset, LanguageSwitch, + BLEEnabled, NUM_ITEMS, }; diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 149f8043..e4d446ad 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -86,6 +86,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp {0, 99, 11, 33}, // OLEDBrightness {0, 5, 1, 1}, // LOGOTime {0, 1, 1, 0}, // CalibrateCJC + {0, 1, 1, 1}, // BLEEnabled }; static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength)); diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index dc35e51f..fc510f76 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -41,6 +41,9 @@ static void displayAdvancedSolderingScreens(void); static void displayAdvancedIDLEScreens(void); static void displayScrollSpeed(void); static void displayPowerLimit(void); +#ifdef BLE_ENABLED +static void displayBLEEnabled(void); +#endif #ifndef NO_DISPLAY_ROTATE static bool setDisplayRotation(void); static void displayDisplayRotation(void); @@ -255,15 +258,19 @@ const menuitem UIMenu[] = { {0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0} // end of menu marker. DO NOT REMOVE }; const menuitem advancedMenu[] = { - /* - * Power Limit - * Calibrate CJC At Next Boot - * Calibrate Input V - * Power Pulse - * -Power Pulse Delay - * -Power Pulse Duration - * Factory Reset - */ +/* + * BLE Enabled or not + * Power Limit + * Calibrate CJC At Next Boot + * Calibrate Input V + * Power Pulse + * -Power Pulse Delay + * -Power Pulse Duration + * Factory Reset + */ +#ifdef BLE_ENABLED + {SETTINGS_DESC(SettingsItemIndex::BLEEnabled), nullptr, displayBLEEnabled, nullptr, SettingsOptions::BLEEnabled, SettingsItemIndex::BLEEnabled, 7}, /*Advanced idle screen*/ +#endif {SETTINGS_DESC(SettingsItemIndex::PowerLimit), nullptr, displayPowerLimit, nullptr, SettingsOptions::PowerLimit, SettingsItemIndex::PowerLimit, 5}, /*Power limit*/ {SETTINGS_DESC(SettingsItemIndex::CalibrateCJC), setCalibrate, displayCalibrate, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::CalibrateCJC, 7}, /*Calibrate Cold Junktion Compensation at next boot*/ @@ -633,7 +640,9 @@ static void displayLogoTime(void) { static void displayAdvancedIDLEScreens(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::DetailedIDLE)); } static void displayAdvancedSolderingScreens(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::DetailedSoldering)); } - +#ifdef BLE_ENABLED +static void displayBLEEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::BLEEnabled)); } +#endif static void displayPowerLimit(void) { if (getSettingValue(SettingsOptions::PowerLimit) == 0) { diff --git a/source/Core/Threads/OperatingModes/Soldering.cpp b/source/Core/Threads/OperatingModes/Soldering.cpp index 5e874f6c..0d997ee6 100644 --- a/source/Core/Threads/OperatingModes/Soldering.cpp +++ b/source/Core/Threads/OperatingModes/Soldering.cpp @@ -127,10 +127,20 @@ void gui_solderingMode(uint8_t jumpToSleep) { } else { OLED::setCursor(67, 0); } - OLED::printNumber(x10WattHistory.average() / 10, 2, FontStyle::SMALL); - OLED::print(SmallSymbolDot, FontStyle::SMALL); - OLED::printNumber(x10WattHistory.average() % 10, 1, FontStyle::SMALL); - OLED::print(SmallSymbolWatts, FontStyle::SMALL); + // Print wattage + { + uint32_t x10Watt = x10WattHistory.average(); + if (x10Watt > 999) { // If we exceed 99.9W we drop the decimal place to keep it all fitting + OLED::print(SmallSymbolSpace, FontStyle::SMALL); + OLED::printNumber(x10WattHistory.average() / 10, 3, FontStyle::SMALL); + OLED::print(SmallSymbolWatts, FontStyle::SMALL); + } else { + OLED::printNumber(x10WattHistory.average() / 10, 2, FontStyle::SMALL); + OLED::print(SmallSymbolDot, FontStyle::SMALL); + OLED::printNumber(x10WattHistory.average() % 10, 1, FontStyle::SMALL); + OLED::print(SmallSymbolWatts, FontStyle::SMALL); + } + } if (OLED::getRotation()) { OLED::setCursor(0, 8);