summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Honal <christoph.honal@web.de>2022-06-27 08:34:01 +0200
committerJF <JF002@users.noreply.github.com>2022-07-07 11:23:05 +0200
commit463355281a21cfe380aef2068cf765a867b6ad01 (patch)
tree1372ad28d1518b618527e7dc4920bc71549966ba
parent0f1e5105740b08d5033737accc6922bad90fb825 (diff)
Display target build variant in system info screen
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/displayapp/screens/SystemInfo.cpp10
2 files changed, 9 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aa06b2b3..967d498b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -788,6 +788,7 @@ add_definitions(-DMYNEWT_VAL_BLE_LL_RFMGMT_ENABLE_TIME=1500)
# Target hardware configuration options
add_definitions(-DTARGET_DEVICE_${TARGET_DEVICE})
+add_definitions(-DTARGET_DEVICE_NAME="${TARGET_DEVICE}")
if(TARGET_DEVICE STREQUAL "PINETIME")
add_definitions(-DDRIVER_PINMAP_PINETIME)
add_definitions(-DCLOCK_CONFIG_LF_SRC=1) # XTAL
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index e3983d7c..7e1ae2f8 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -136,6 +136,10 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
uptimeSeconds = uptimeSeconds % secondsInAMinute;
// TODO handle more than 100 days of uptime
+#ifndef TARGET_DEVICE_NAME
+ #define TARGET_DEVICE_NAME "UNKNOWN"
+#endif
+
lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_recolor(label, true);
lv_label_set_text_fmt(label,
@@ -146,7 +150,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
"#808080 Backlight# %s\n"
"#808080 Last reset# %s\n"
"#808080 Accel.# %s\n"
- "#808080 Touch.# %x.%x.%x\n",
+ "#808080 Touch.# %x.%x.%x\n"
+ "#808080 Model# %s",
dateTimeController.Day(),
static_cast<uint8_t>(dateTimeController.Month()),
dateTimeController.Year(),
@@ -164,7 +169,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
ToString(motionController.DeviceType()),
touchPanel.GetChipId(),
touchPanel.GetVendorId(),
- touchPanel.GetFwVersion());
+ touchPanel.GetFwVersion(),
+ TARGET_DEVICE_NAME);
lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
return std::make_unique<Screens::Label>(1, 5, app, label);
}