show target version, date, commit hash and branch (#221)
This commit is contained in:
parent
eb2679b982
commit
bce6f867f1
@ -20,10 +20,12 @@ void irukagotchi_draw_callback(CanvasApi* canvas, void* context) {
|
||||
|
||||
canvas->clear(canvas);
|
||||
canvas->set_color(canvas, ColorBlack);
|
||||
canvas->set_font(canvas, FontPrimary);
|
||||
canvas->draw_icon(canvas, 0, 0, irukagotchi->icon);
|
||||
canvas->draw_str(canvas, 80, 30, "111001");
|
||||
canvas->draw_str(canvas, 80, 42, "011010");
|
||||
canvas->draw_icon(canvas, 128 - 80, 0, irukagotchi->icon);
|
||||
canvas->set_font(canvas, FontSecondary);
|
||||
canvas->draw_str(canvas, 2, 10, TARGET " " BUILD_DATE);
|
||||
canvas->draw_str(canvas, 2, 22, GIT_BRANCH);
|
||||
canvas->draw_str(canvas, 2, 34, GIT_BRANCH_NUM);
|
||||
canvas->draw_str(canvas, 2, 46, GIT_COMMIT);
|
||||
}
|
||||
|
||||
void irukagotchi_input_callback(InputEvent* event, void* context) {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.6 KiB |
@ -12,5 +12,6 @@ TARGET ?= f2
|
||||
TARGET_DIR = targets/$(TARGET)
|
||||
include $(TARGET_DIR)/target.mk
|
||||
|
||||
include $(PROJECT_ROOT)/make/git.mk
|
||||
include $(PROJECT_ROOT)/make/toolchain.mk
|
||||
include $(PROJECT_ROOT)/make/rules.mk
|
||||
|
@ -14,5 +14,6 @@ TARGET ?= f2
|
||||
TARGET_DIR = targets/$(TARGET)
|
||||
include $(TARGET_DIR)/target.mk
|
||||
|
||||
include $(PROJECT_ROOT)/make/git.mk
|
||||
include $(PROJECT_ROOT)/make/toolchain.mk
|
||||
include $(PROJECT_ROOT)/make/rules.mk
|
||||
|
7
make/git.mk
Normal file
7
make/git.mk
Normal file
@ -0,0 +1,7 @@
|
||||
GIT_COMMIT = $(shell git describe --always --exclude '*' || echo 'unknown')
|
||||
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD || echo 'unknown')
|
||||
GIT_BRANCH_NUM = $(shell git rev-list --count $(GIT_BRANCH) || echo 'nan')
|
||||
BUILD_DATE = $(shell date '+%d-%m-%Y' || echo 'unknown')
|
||||
|
||||
CFLAGS += -DGIT_COMMIT="\"$(GIT_COMMIT)\"" -DGIT_BRANCH="\"$(GIT_BRANCH)\"" -DGIT_BRANCH_NUM="\"$(GIT_BRANCH_NUM)\""
|
||||
CFLAGS += -DBUILD_DATE="\"$(BUILD_DATE)\"" -DTARGET="\"$(TARGET)\""
|
Loading…
Reference in New Issue
Block a user