Skip to content

Commit a4de61e

Browse files
author
Stoian Minaiev
committed
git: show git short ref hash on SystemInfo(first screen) and FirmwareValidation screen alongside other information
1 parent e04c8ee commit a4de61e

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/displayapp/screens/FirmwareValidation.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app,
2727
sprintf(version, "%ld.%ld.%ld", Version::Major(), Version::Minor(), Version::Patch());
2828
lv_label_set_text(labelVersionValue, version);
2929

30+
labelShortRefInfo = lv_label_create(lv_scr_act(), nullptr);
31+
lv_obj_align(labelShortRefInfo, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 25);
32+
lv_label_set_text(labelShortRefInfo, "ShortRef : ");
33+
lv_label_set_align(labelShortRefInfo, LV_LABEL_ALIGN_LEFT);
34+
35+
labelShortRefValue = lv_label_create(lv_scr_act(), nullptr);
36+
lv_obj_align(labelShortRefValue, labelShortRefInfo, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
37+
lv_label_set_recolor(labelShortRefValue, true);
38+
sprintf(shortref, "%s", Version::GitCommitHash());
39+
lv_label_set_text(labelShortRefValue, shortref);
40+
3041
labelIsValidated = lv_label_create(lv_scr_act(), nullptr);
3142
lv_obj_align(labelIsValidated, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 50);
3243
lv_label_set_recolor(labelIsValidated, true);

src/displayapp/screens/FirmwareValidation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ namespace Pinetime {
2525

2626
lv_obj_t* labelVersionInfo;
2727
lv_obj_t* labelVersionValue;
28+
lv_obj_t* labelShortRefInfo;
29+
lv_obj_t* labelShortRefValue;
2830
char version[9];
31+
char shortref[9];
2932
lv_obj_t* labelIsValidated;
3033
lv_obj_t* buttonValidate;
3134
lv_obj_t* labelButtonValidate;

src/displayapp/screens/SystemInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
6969
lv_label_set_text_fmt(label,
7070
"#FFFF00 InfiniTime#\n\n"
7171
"#444444 Version# %ld.%ld.%ld\n\n"
72+
"#444444 Short Ref# %s\n\n"
7273
"#444444 Build date#\n"
7374
"%s\n"
7475
"%s\n",
7576
Version::Major(),
7677
Version::Minor(),
7778
Version::Patch(),
79+
Version::GitCommitHash(),
7880
__DATE__,
7981
__TIME__);
8082
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);

0 commit comments

Comments
 (0)