mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Add opt-in Fusion development firmware build
This commit is contained in:
1 parent
bf7eda8a48
commit
7f906300e3
10 files changed
+69
-13
No files matched your search
@@ -70,6 +70,7 @@ if(ENABLE_FEAT_F4HWN)
|
|||||||
"AUTHOR_STRING_2=\"${AUTHOR_STRING_2}\""
|
"AUTHOR_STRING_2=\"${AUTHOR_STRING_2}\""
|
||||||
"VERSION_STRING_1=\"${VERSION_STRING_1}\""
|
"VERSION_STRING_1=\"${VERSION_STRING_1}\""
|
||||||
"VERSION_STRING_2=\"${VERSION_STRING_2}\""
|
"VERSION_STRING_2=\"${VERSION_STRING_2}\""
|
||||||
|
"DISPLAY_VERSION_STRING_2=\"${DISPLAY_VERSION_STRING_2}\""
|
||||||
"EDITION_STRING=\"${EDITION_STRING}\""
|
"EDITION_STRING=\"${EDITION_STRING}\""
|
||||||
ALERT_TOT=10
|
ALERT_TOT=10
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -1187,7 +1187,7 @@ void UI_DisplayMenu(void)
|
|||||||
if (page == p++) {
|
if (page == p++) {
|
||||||
// Page 0: firmware identity.
|
// Page 0: firmware identity.
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#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);
|
UI_PrintStringSmallNormal(Edition, menu_item_x1 - 1, menu_item_x2, 6);
|
||||||
#else
|
#else
|
||||||
sprintf(String, "%u.%02uV\n%u%%",
|
sprintf(String, "%u.%02uV\n%u%%",
|
||||||
|
|||||||
+23
-6
@@ -20,6 +20,7 @@
|
|||||||
#include "driver/py25q16.h"
|
#include "driver/py25q16.h"
|
||||||
#include "driver/st7565.h"
|
#include "driver/st7565.h"
|
||||||
#include "external/printf/printf.h"
|
#include "external/printf/printf.h"
|
||||||
|
#include "font.h"
|
||||||
#include "helper/battery.h"
|
#include "helper/battery.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
@@ -312,17 +313,33 @@ void UI_DisplayWelcome(void)
|
|||||||
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#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);
|
UI_PrintStringSmallNormal(DisplayVersion, version_x, 0, 4);
|
||||||
gFrameBuffer[4][19] ^= 0x7F;
|
|
||||||
for (uint8_t x = 20; x < 108; x++)
|
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[4][x] ^= 0xFF;
|
||||||
gFrameBuffer[3][x] ^= 0x80;
|
gFrameBuffer[3][x] ^= 0x80;
|
||||||
}
|
}
|
||||||
gFrameBuffer[4][108] ^= 0x7F;
|
gFrameBuffer[4][capsule_right] ^= 0x7F;
|
||||||
UI_DrawLineBuffer(gFrameBuffer, 109, 35, 127, 35, 1);
|
if (capsule_right < LCD_WIDTH - 1u)
|
||||||
|
{
|
||||||
|
UI_DrawLineBuffer(gFrameBuffer, capsule_right + 1u, 35, LCD_WIDTH - 1u, 35, 1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef ENABLE_FEAT_F4HWN_MEM
|
#ifdef ENABLE_FEAT_F4HWN_MEM
|
||||||
|
|||||||
+6
-5
@@ -6,11 +6,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2;
|
const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2;
|
||||||
const char Edition[] = EDITION_STRING;
|
const char DisplayVersion[] = AUTHOR_STRING_2 " " DISPLAY_VERSION_STRING_2;
|
||||||
const char BuildDate[] = __DATE__;
|
const char Edition[] = EDITION_STRING;
|
||||||
const char BuildTime[] = __TIME__;
|
const char BuildDate[] = __DATE__;
|
||||||
const char BuildCommit[] = BUILD_COMMIT;
|
const char BuildTime[] = __TIME__;
|
||||||
|
const char BuildCommit[] = BUILD_COMMIT;
|
||||||
#else
|
#else
|
||||||
const char Version[] = AUTHOR_STRING VER;
|
const char Version[] = AUTHOR_STRING VER;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ extern const char UART_Version[];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
extern const char DisplayVersion[];
|
||||||
extern const char Edition[];
|
extern const char Edition[];
|
||||||
extern const char BuildDate[];
|
extern const char BuildDate[];
|
||||||
extern const char BuildTime[];
|
extern const char BuildTime[];
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ message("Build type: " ${CMAKE_BUILD_TYPE})
|
|||||||
|
|
||||||
enable_language(C ASM)
|
enable_language(C ASM)
|
||||||
|
|
||||||
|
option(DEV "Prepare the rolling Fusion development firmware" OFF)
|
||||||
|
|
||||||
find_package(Git QUIET)
|
find_package(Git QUIET)
|
||||||
set(BUILD_COMMIT "unknown")
|
set(BUILD_COMMIT "unknown")
|
||||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||||
@@ -71,7 +73,17 @@ else()
|
|||||||
set(EXE_NAME "firmware")
|
set(EXE_NAME "firmware")
|
||||||
endif()
|
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("EXE_NAME = " ${EXE_NAME})
|
||||||
|
message("Development build = " ${DEV})
|
||||||
|
|
||||||
add_executable(${EXE_NAME})
|
add_executable(${EXE_NAME})
|
||||||
|
|
||||||
@@ -110,6 +122,17 @@ add_custom_command(
|
|||||||
COMMENT "Generating .bin file"
|
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
|
# Generate .hex file
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${EXE_NAME}
|
TARGET ${EXE_NAME}
|
||||||
|
|||||||
+2
-1
@@ -9,6 +9,7 @@
|
|||||||
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake",
|
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release",
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
|
"DEV": false,
|
||||||
"ENABLE_LTO": false,
|
"ENABLE_LTO": false,
|
||||||
"ENABLE_FMRADIO": false,
|
"ENABLE_FMRADIO": false,
|
||||||
"ENABLE_UART": true,
|
"ENABLE_UART": true,
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
"ENABLE_UART_RW_BK_REGS": false,
|
"ENABLE_UART_RW_BK_REGS": false,
|
||||||
"ENABLE_SWD": false,
|
"ENABLE_SWD": false,
|
||||||
"VERSION_STRING_1": "v0.22",
|
"VERSION_STRING_1": "v0.22",
|
||||||
"VERSION_STRING_2": "v5.7.0"
|
"VERSION_STRING_2": "v5.7.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -285,6 +285,17 @@ Examples:
|
|||||||
./compile-with-docker.sh Fusion -DSQL_TONE=600
|
./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
|
### Notes
|
||||||
|
|
||||||
- The first run may take a few minutes while Docker builds the base image.
|
- The first run may take a few minutes while Docker builds the base image.
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
@@ -8,6 +8,7 @@ set -euo pipefail
|
|||||||
# ./compile-with-docker.sh Custom
|
# ./compile-with-docker.sh Custom
|
||||||
# ./compile-with-docker.sh Bandscope -DENABLE_SPECTRUM=ON
|
# ./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 Broadcast -DENABLE_FEAT_F4HWN_GAME=ON -DENABLE_NOAA=ON
|
||||||
|
# ./compile-with-docker.sh Fusion -DDEV=ON
|
||||||
# ./compile-with-docker.sh All
|
# ./compile-with-docker.sh All
|
||||||
# Default preset: "Custom"
|
# Default preset: "Custom"
|
||||||
# ---------------------------------------------
|
# ---------------------------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user