mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Add SysInf build details page
This commit is contained in:
1 parent
a65f84305e
commit
2f0852cd03
6 files changed
+36
-12
No files matched your search
@@ -78,6 +78,7 @@ endif()
|
||||
target_compile_definitions(App INTERFACE
|
||||
"AUTHOR_STRING=\"${AUTHOR_STRING}\""
|
||||
"VERSION_STRING=\"${VERSION_STRING}\""
|
||||
"BUILD_COMMIT=\"${BUILD_COMMIT}\""
|
||||
)
|
||||
|
||||
if(NOT SQL_TONE)
|
||||
|
||||
+3
-2
@@ -460,12 +460,13 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
|
||||
case MENU_VOL: {
|
||||
// SysInf paginates:
|
||||
// page 0 = identity,
|
||||
// page 1 = battery,
|
||||
// page 1 = build date/time,
|
||||
// page 2 = battery,
|
||||
// +1 if F4HWN_MEM (Flash/SRAM),
|
||||
// +2 if F4HWN_QRCODE (Code QR + Wiki QR).
|
||||
int32_t vol_max = 0;
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
vol_max += 1;
|
||||
vol_max += 2;
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN_MEM
|
||||
vol_max += 1;
|
||||
|
||||
+11
-10
@@ -1134,6 +1134,7 @@ void UI_DisplayMenu(void)
|
||||
// SysInf is paginated. Pages appear in this order, only when their
|
||||
// feature flag is enabled:
|
||||
// 0 -> identity
|
||||
// next -> Build date/time (ENABLE_FEAT_F4HWN)
|
||||
// next -> Battery (ENABLE_FEAT_F4HWN)
|
||||
// next -> Flash / SRAM usage (ENABLE_FEAT_F4HWN_MEM)
|
||||
// next, +1 -> CODE / WIKI QR codes (ENABLE_FEAT_F4HWN_QRCODE)
|
||||
@@ -1153,6 +1154,16 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
}
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (page == p++) {
|
||||
UI_PrintStringSmallNormalInverse("BUILD", 70, 0, 1);
|
||||
UI_PrintStringSmallNormal(BuildDate, 49, 127, 3);
|
||||
UI_PrintStringSmallNormal(BuildTime, 49, 127, 4);
|
||||
UI_PrintStringSmallNormal(BuildCommit, 49, 127, 6);
|
||||
|
||||
already_printed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (page == p++) {
|
||||
char val[16];
|
||||
|
||||
@@ -1433,16 +1444,6 @@ void UI_DisplayMenu(void)
|
||||
|
||||
y = (small ? 3 : 2) - (lines / 2);
|
||||
|
||||
// Page 0 gets a fixed vertical position; other SysInf pages own their layout.
|
||||
if(UI_MENU_GetCurrentMenuId() == MENU_VOL && gSubMenuSelection == 0)
|
||||
{
|
||||
//#ifdef ENABLE_FEAT_F4HWN
|
||||
// UI_PrintStringSmallNormal(VERSION_STRING_2, 54, 127, 6);
|
||||
//#endif
|
||||
|
||||
y = 1;
|
||||
}
|
||||
|
||||
// draw the text lines
|
||||
for (i = 0; i < len && lines > 0; lines--)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#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;
|
||||
#else
|
||||
const char Version[] = AUTHOR_STRING VER;
|
||||
#endif
|
||||
|
||||
@@ -24,4 +24,7 @@ extern const char UART_Version[];
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
extern const char Edition[];
|
||||
extern const char BuildDate[];
|
||||
extern const char BuildTime[];
|
||||
extern const char BuildCommit[];
|
||||
#endif
|
||||
@@ -19,6 +19,21 @@ message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
enable_language(C ASM)
|
||||
|
||||
find_package(Git QUIET)
|
||||
set(BUILD_COMMIT "unknown")
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE BUILD_COMMIT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(NOT BUILD_COMMIT)
|
||||
set(BUILD_COMMIT "unknown")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_FEAT_F4HWN)
|
||||
if(NOT AUTHOR_STRING_1)
|
||||
set(AUTHOR_STRING_1 "EGZUMER")
|
||||
|
||||
Reference in new issue
Block a user