Skip to content

Commit b5890f0

Browse files
committed
Display target build variant in system info screen
1 parent c0770cd commit b5890f0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ add_definitions(-D__HEAP_SIZE=4096)
785785

786786
# Target hardware configuration options
787787
add_definitions(-DTARGET_DEVICE_${TARGET_DEVICE})
788+
add_definitions(-DTARGET_DEVICE_NAME="${TARGET_DEVICE}")
788789
if(TARGET_DEVICE STREQUAL "PINETIME")
789790
add_definitions(-DDRIVER_PINMAP_PINETIME)
790791
add_definitions(-DCLOCK_CONFIG_LF_SRC=1) # XTAL

src/displayapp/screens/SystemInfo.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
136136
uptimeSeconds = uptimeSeconds % secondsInAMinute;
137137
// TODO handle more than 100 days of uptime
138138

139+
#ifndef TARGET_DEVICE_NAME
140+
#define TARGET_DEVICE_NAME "UNKNOWN"
141+
#endif
142+
139143
lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr);
140144
lv_label_set_recolor(label, true);
141145
lv_label_set_text_fmt(label,
@@ -146,7 +150,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
146150
"#808080 Backlight# %s\n"
147151
"#808080 Last reset# %s\n"
148152
"#808080 Accel.# %s\n"
149-
"#808080 Touch.# %x.%x.%x\n",
153+
"#808080 Touch.# %x.%x.%x\n"
154+
"#808080 Model# %s",
150155
dateTimeController.Day(),
151156
static_cast<uint8_t>(dateTimeController.Month()),
152157
dateTimeController.Year(),
@@ -164,7 +169,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
164169
ToString(motionController.DeviceType()),
165170
touchPanel.GetChipId(),
166171
touchPanel.GetVendorId(),
167-
touchPanel.GetFwVersion());
172+
touchPanel.GetFwVersion(),
173+
TARGET_DEVICE_NAME);
168174
lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
169175
return std::make_unique<Screens::Label>(1, 5, app, label);
170176
}

0 commit comments

Comments
 (0)