Skip to content

SystemInfo: Display target build variant #1204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ add_definitions(-D__HEAP_SIZE=4096)

# 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
Expand Down
10 changes: 8 additions & 2 deletions src/displayapp/screens/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
Expand All @@ -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);
}
Expand Down