diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a8145070..bbd3949b 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -215,7 +215,7 @@ jobs: steps: - name: Install dependencies (apk) - run: apk add --no-cache git + run: apk add --no-cache git bash grep - uses: actions/checkout@v4 with: @@ -227,4 +227,4 @@ jobs: run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" - name: Check and verify documentation - run: /bin/sh ./scripts/deploy.sh docs + run: ./scripts/deploy.sh docs diff --git a/Makefile b/Makefile index 20453f4c..c22f6718 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,7 @@ test-md: @echo "" @echo "---- Checking documentation... ----" @echo "" - @/bin/sh ./scripts/deploy.sh docs + @./scripts/deploy.sh docs # shell style & linter check (github CI version of shellcheck is more recent than alpine one so the latter may not catch some policies) test-sh: diff --git a/README.md b/README.md index 6d4fee8d..fa6e30df 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,22 @@ After powering on the device for the first time with _IronOS_ installed and havi Additional details are described in the [menu information](https://ralim.github.io/IronOS/Menu/). +## Remote Control + +### Pinecil V2 only + +Pinecil V2 has [_Bluetooth Low Energy_ module](https://ralim.github.io/IronOS/Bluetooth), which is supported by _IronOS_ since `2.21` release to control some of the settings using additional tools like [PineSAM](https://github.com/builder555/PineSAM) or [PineTool](https://github.com/lachlanbell/PineTool). In `2.21` and `2.22` releases the module was _on_ by default. However, **_Bluetooth_ is turned off in the settings by default in current `dev` builds and for the next releases** [due to security concerns](#1856).[^ble] + +To enable _Bluetooth_ back: +- go to _Settings_ menu; +- press `-/B` button four times to scroll the menu for `Advanced settings`; +- press `+/A` button to open submenu; +- press `+/A` button to toggle/enable _Bluetooth_ feature; +- press `-/B` **and hold it** for just more than five seconds to exit from the _Settings_ menu. + +[^ble]: + This is related only to situations when a user restores default settings using menu, or when _IronOS_ update is taking place on a new device or on a device with a previous firmware version. + ## Translations Is your preferred language missing localisation of some of the text? @@ -175,6 +191,6 @@ Other components such as _FreeRTOS_ and _USB-PD_ have their own licenses. ## Commercial Use -This software is provided "AS IS", so I cannot provide any commercial support for the firmware. +This software is provided _**"AS IS"**_, so I cannot provide any commercial support for the firmware. However, you are more than welcome to distribute links to the firmware or provide hardware with this firmware. **Please do not re-host the files, but rather link to this page, so that there are no old versions of the firmware scattered around**. diff --git a/Translations/translation_UZ.json b/Translations/translation_UZ.json index bf74b696..ca25f81b 100644 --- a/Translations/translation_UZ.json +++ b/Translations/translation_UZ.json @@ -137,7 +137,7 @@ "menuOptions": { "DCInCutoff": { "displayText": "Quvvat\nmanbai", - "description": "Batareya haddan tashqari zaryadsizlanishini oldini olish uchun kuchlanish chegarasini o'rnatish (DC 10V) (S=3.3V har bir yacheyka uchun, quvvat PWR chegarasini o'chirish)" + "description": "Batareya haddan tashqari zaryadsizlanishini oldini olish uchun kuchlanish chegarasini o'rnatish (DC 10V) (S=3.3V har bir yacheyka uchun, quvvat PWR chegarasini o'chirish)" }, "MinVolCell": { "displayText": "Minimal\nkuchlanish", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 3f34e5b6..5ebd28df 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -95,9 +95,10 @@ docs_links() { ver_git="$(git tag -l | sort | grep -e "^v" | grep -v "rc" | tail -1)" md="README.md" + test -f "${md}" || (echo "deploy.sh: docs_links: ERROR with the project directory structure!" && exit 1) ver_md="$(grep -c "${ver_git}" "${md}")" ret=0 - if [ "${ver_md}" -ne 0 ]; then + if [ "${ver_md}" -eq 0 ]; then ret=1 echo "Please, update mention & links in ${md} inside Builds section for release builds with version ${ver_git}." fi; @@ -108,16 +109,38 @@ docs_links() build_langs() { mk="../source/Makefile" - cd Translations/ || exit 1 + cd Translations/ || (echo "deploy.sh: build_langs: ERROR with the project directory structure!" && exit 1) langs="$(echo "$(find ./*.json | sed -ne 's,^\./translation_,,; s,\.json$,,; /[A-Z]/p' ; sed -ne 's/^ALL_LANGUAGES=//p;' "${mk}")" | sed 's, ,\n,g; s,\r,,g' | sort | uniq -u)" - ret=0 if [ -n "${langs}" ]; then - ret=1 echo "It seems there is mismatch between supported languages and enabled builds." echo "Please, check files in Translations/ and ALL_LANGUAGES variable in source/Makefile for:" echo "${langs}" + return 1 fi; - return "${ret}" + cd .. + + echo -ne "\n" + grep -nH $'\11' Translations/translation*.json + ret="${?}" + if [ "${ret}" -eq 0 ]; then + echo -ne "\t^^^^\t^^^^\n" + echo "Please, remove any tabs as indention from json file(s) in Translations/ directory (see the exact files & lines in the list above)." + echo "Use spaces only to indent in the future, please." + echo -ne "\n" + return 1 + fi; + + grep -nEH -e "^( {1}| {3}| {5}| {7}| {9}| {11})[^ ]" Translations/translation*.json + ret="${?}" + if [ "${ret}" -eq 0 ]; then + echo -ne "\t^^^^\t^^^^\n" + echo "Please, remove any odd amount of extra spaces as indention from json file(s) in Translations/ directory (see the exact files & lines in the list above)." + echo "Use even amount of spaces to indent in the future, please (two actual spaces per one indent, not tab)." + echo -ne "\n" + return 1 + fi; + + return 0 } # Helper function to check code style using clang-format & grep/sed custom parsers: diff --git a/source/Core/Drivers/OLED.cpp b/source/Core/Drivers/OLED.cpp index adde9d2b..542b6dc6 100644 --- a/source/Core/Drivers/OLED.cpp +++ b/source/Core/Drivers/OLED.cpp @@ -11,6 +11,7 @@ #include "cmsis_os.h" #include "configuration.h" #include +#include #include #include @@ -209,21 +210,18 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const ui * of the indicator in pixels (0..<16). */ void OLED::drawScrollIndicator(uint8_t y, uint8_t height) { - union u_type { - uint32_t whole; - uint8_t strips[4]; - } column; - - column.whole = (1 << height) - 1; // preload a set of set bits of height - column.whole <<= y; // Shift down by the y value + const uint32_t whole = ((1 << height) - 1) << y; // preload a set of set bits of height + // Shift down by the y value + const uint8_t strips[4] = {static_cast(whole & 0xff), static_cast((whole & 0xff00) >> 8 * 1), static_cast((whole & 0xff0000) >> 8 * 2), + static_cast((whole & 0xff000000) >> 8 * 3)}; // Draw a one pixel wide bar to the left with a single pixel as // the scroll indicator. - fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]); - fillArea(OLED_WIDTH - 1, 8, 1, 8, column.strips[1]); + fillArea(OLED_WIDTH - 1, 0, 1, 8, strips[0]); + fillArea(OLED_WIDTH - 1, 8, 1, 8, strips[1]); #if OLED_HEIGHT == 32 - fillArea(OLED_WIDTH - 1, 16, 1, 8, column.strips[2]); - fillArea(OLED_WIDTH - 1, 24, 1, 8, column.strips[3]); + fillArea(OLED_WIDTH - 1, 16, 1, 8, strips[2]); + fillArea(OLED_WIDTH - 1, 24, 1, 8, strips[3]); #endif } diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index 0a30f9b6..728e1e21 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -582,7 +582,6 @@ static void setBoostTemp(void) { if (value >= MAX_TEMP_F) { value = 0; // jump to off } - setSettingValue(SettingsOptions::BoostTemp, value); } else { if (value == 0) { value = MIN_BOOST_TEMP_C; // loop back at 250 @@ -657,14 +656,13 @@ static void setProfileTemp(const enum SettingsOptions option) { if (temp > MAX_TEMP_F) { temp = MIN_TEMP_F; } - setSettingValue(option, temp); } else { temp += 5; if (temp > MAX_TEMP_C) { temp = MIN_TEMP_C; } - setSettingValue(option, temp); } + setSettingValue(option, temp); } static void setProfilePreheatTemp(void) { return setProfileTemp(SettingsOptions::ProfilePreheatTemp); } @@ -715,14 +713,13 @@ static void setSleepTemp(void) { if (temp > 580) { temp = 60; } - setSettingValue(SettingsOptions::SleepTemp, temp); } else { temp += 10; if (temp > 300) { temp = 10; } - setSettingValue(SettingsOptions::SleepTemp, temp); } + setSettingValue(SettingsOptions::SleepTemp, temp); } static void displaySleepTemp(void) { OLED::printNumber(getSettingValue(SettingsOptions::SleepTemp), 3, FontStyle::LARGE); } @@ -762,12 +759,11 @@ static bool showHallEffect(void) { return getHallSensorFitted(); } static void displayHallEffectSleepTime(void) { if (getSettingValue(SettingsOptions::HallEffectSleepTime)) { OLED::printNumber(getSettingValue(SettingsOptions::HallEffectSleepTime) * 5, 2, FontStyle::LARGE, false); - OLED::print(LargeSymbolSeconds, FontStyle::LARGE); } else { // When sleep time is set to zero, we sleep for 1 second anyways. This is the default. OLED::printNumber(1, 2, FontStyle::LARGE, false); - OLED::print(LargeSymbolSeconds, FontStyle::LARGE); } + OLED::print(LargeSymbolSeconds, FontStyle::LARGE); } #endif /* HALL_SENSOR */