diff --git a/App/CMakeLists.txt b/App/CMakeLists.txt index 0fdd20ce..09d33e28 100644 --- a/App/CMakeLists.txt +++ b/App/CMakeLists.txt @@ -70,6 +70,7 @@ if(ENABLE_FEAT_F4HWN) "AUTHOR_STRING_2=\"${AUTHOR_STRING_2}\"" "VERSION_STRING_1=\"${VERSION_STRING_1}\"" "VERSION_STRING_2=\"${VERSION_STRING_2}\"" + "DISPLAY_VERSION_STRING_2=\"${DISPLAY_VERSION_STRING_2}\"" "EDITION_STRING=\"${EDITION_STRING}\"" ALERT_TOT=10 ) diff --git a/App/ui/menu.c b/App/ui/menu.c index 65975b1a..febae9a6 100644 --- a/App/ui/menu.c +++ b/App/ui/menu.c @@ -1187,7 +1187,7 @@ void UI_DisplayMenu(void) if (page == p++) { // Page 0: firmware identity. #ifdef ENABLE_FEAT_F4HWN - sprintf(String, "%s\n%s", AUTHOR_STRING_2, VERSION_STRING_2); + sprintf(String, "%s\n%s", AUTHOR_STRING_2, DISPLAY_VERSION_STRING_2); UI_PrintStringSmallNormal(Edition, menu_item_x1 - 1, menu_item_x2, 6); #else sprintf(String, "%u.%02uV\n%u%%", diff --git a/App/ui/welcome.c b/App/ui/welcome.c index 798526c5..0547f468 100644 --- a/App/ui/welcome.c +++ b/App/ui/welcome.c @@ -20,6 +20,7 @@ #include "driver/py25q16.h" #include "driver/st7565.h" #include "external/printf/printf.h" +#include "font.h" #include "helper/battery.h" #include "settings.h" #include "misc.h" @@ -312,17 +313,33 @@ void UI_DisplayWelcome(void) UI_PrintString(WelcomeString1, 0, 127, 2, 10); #ifdef ENABLE_FEAT_F4HWN - UI_PrintStringSmallNormal(Version, 0, 128, 4); + const size_t version_width = strlen(DisplayVersion) * (ARRAY_SIZE(gFontSmall[0]) + 1u); + const uint8_t version_x = version_width < LCD_WIDTH + ? (uint8_t)((LCD_WIDTH - version_width + 1u) / 2u) + : 0u; + const uint8_t capsule_left = version_x > 2u ? (uint8_t)(version_x - 3u) : 0u; + const size_t capsule_right_candidate = version_x + version_width + 2u; + const uint8_t capsule_right = capsule_right_candidate < LCD_WIDTH + ? (uint8_t)capsule_right_candidate + : (LCD_WIDTH - 1u); - UI_DrawLineBuffer(gFrameBuffer, 0, 35, 18, 35, 1); - gFrameBuffer[4][19] ^= 0x7F; - for (uint8_t x = 20; x < 108; x++) + UI_PrintStringSmallNormal(DisplayVersion, version_x, 0, 4); + + if (capsule_left > 0u) + { + UI_DrawLineBuffer(gFrameBuffer, 0, 35, capsule_left - 1u, 35, 1); + } + gFrameBuffer[4][capsule_left] ^= 0x7F; + for (uint8_t x = capsule_left + 1u; x < capsule_right; x++) { gFrameBuffer[4][x] ^= 0xFF; gFrameBuffer[3][x] ^= 0x80; } - gFrameBuffer[4][108] ^= 0x7F; - UI_DrawLineBuffer(gFrameBuffer, 109, 35, 127, 35, 1); + gFrameBuffer[4][capsule_right] ^= 0x7F; + if (capsule_right < LCD_WIDTH - 1u) + { + UI_DrawLineBuffer(gFrameBuffer, capsule_right + 1u, 35, LCD_WIDTH - 1u, 35, 1); + } /* #ifdef ENABLE_FEAT_F4HWN_MEM diff --git a/App/version.c b/App/version.c index 5b854a05..31ef85af 100644 --- a/App/version.c +++ b/App/version.c @@ -6,11 +6,12 @@ #endif #ifdef ENABLE_FEAT_F4HWN - const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2; - const char Edition[] = EDITION_STRING; - const char BuildDate[] = __DATE__; - const char BuildTime[] = __TIME__; - const char BuildCommit[] = BUILD_COMMIT; + const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2; + const char DisplayVersion[] = AUTHOR_STRING_2 " " DISPLAY_VERSION_STRING_2; + const char Edition[] = EDITION_STRING; + const char BuildDate[] = __DATE__; + const char BuildTime[] = __TIME__; + const char BuildCommit[] = BUILD_COMMIT; #else const char Version[] = AUTHOR_STRING VER; #endif diff --git a/App/version.h b/App/version.h index 80467895..7b2a55c1 100644 --- a/App/version.h +++ b/App/version.h @@ -23,6 +23,7 @@ extern const char UART_Version[]; #endif #ifdef ENABLE_FEAT_F4HWN +extern const char DisplayVersion[]; extern const char Edition[]; extern const char BuildDate[]; extern const char BuildTime[]; diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6ad2ed..0c13acd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ message("Build type: " ${CMAKE_BUILD_TYPE}) enable_language(C ASM) +option(DEV "Prepare the rolling Fusion development firmware" OFF) + find_package(Git QUIET) set(BUILD_COMMIT "unknown") if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") @@ -71,7 +73,17 @@ else() set(EXE_NAME "firmware") endif() +if(DEV) + if(NOT "${TARGET}" STREQUAL "f4hwn.fusion") + message(FATAL_ERROR "DEV is only supported for the Fusion target") + endif() + set(DISPLAY_VERSION_STRING_2 "${VERSION_STRING_2} Dev") +else() + set(DISPLAY_VERSION_STRING_2 "${VERSION_STRING_2}") +endif() + message("EXE_NAME = " ${EXE_NAME}) +message("Development build = " ${DEV}) add_executable(${EXE_NAME}) @@ -110,6 +122,17 @@ add_custom_command( COMMENT "Generating .bin file" ) +if(DEV) + add_custom_command( + TARGET ${EXE_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.bin" + "${CMAKE_SOURCE_DIR}/archive/f4hwn.fusion.development.bin" + COMMENT "Preparing archive/f4hwn.fusion.development.bin" + ) +endif() + # Generate .hex file add_custom_command( TARGET ${EXE_NAME} diff --git a/CMakePresets.json b/CMakePresets.json index 960fed01..fe155522 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,6 +9,7 @@ "toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "DEV": false, "ENABLE_LTO": false, "ENABLE_FMRADIO": false, "ENABLE_UART": true, @@ -81,7 +82,7 @@ "ENABLE_UART_RW_BK_REGS": false, "ENABLE_SWD": false, "VERSION_STRING_1": "v0.22", - "VERSION_STRING_2": "v5.7.0" + "VERSION_STRING_2": "v5.7.1" } }, { diff --git a/README.md b/README.md index 0d74699d..27a419a9 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,17 @@ Examples: ./compile-with-docker.sh Fusion -DSQL_TONE=600 ``` +To prepare the rolling development firmware: + +```bash +./compile-with-docker.sh Fusion -DDEV=ON +``` + +This keeps the regular build output in `build/Fusion` and also updates +`archive/f4hwn.fusion.development.bin`. The development build is identified as +`DEV` in the firmware information screen. Publishing the updated archive file +remains an explicit Git operation. + ### Notes - The first run may take a few minutes while Docker builds the base image. diff --git a/archive/f4hwn.fusion.development.bin b/archive/f4hwn.fusion.development.bin new file mode 100755 index 00000000..4c61f895 Binary files /dev/null and b/archive/f4hwn.fusion.development.bin differ diff --git a/compile-with-docker.sh b/compile-with-docker.sh index 3dfd0b1f..aca105a6 100755 --- a/compile-with-docker.sh +++ b/compile-with-docker.sh @@ -8,6 +8,7 @@ set -euo pipefail # ./compile-with-docker.sh Custom # ./compile-with-docker.sh Bandscope -DENABLE_SPECTRUM=ON # ./compile-with-docker.sh Broadcast -DENABLE_FEAT_F4HWN_GAME=ON -DENABLE_NOAA=ON +# ./compile-with-docker.sh Fusion -DDEV=ON # ./compile-with-docker.sh All # Default preset: "Custom" # ---------------------------------------------