From 901b2fbea48abf3c12cfc810692ca409c256b16f Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 16 Feb 2021 13:14:49 +0100 Subject: [PATCH] version --- cube/Makefile | 5 ++++- cube/User/Src/main2.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cube/Makefile b/cube/Makefile index 365e0ae..d831d26 100644 --- a/cube/Makefile +++ b/cube/Makefile @@ -26,6 +26,9 @@ ifndef NETWORK $(error NETWORK is not set) endif +VERSION := $(shell git rev-parse --short=8 HEAD) + + ###################################### # target ###################################### @@ -178,7 +181,7 @@ endif # compile gcc flags ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -Werror -fdata-sections -ffunction-sections -CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK=$(NETWORK) -Wall -Werror -fdata-sections -ffunction-sections +CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK=$(NETWORK) -DVERSION="\"$(VERSION)\"" -Wall -Werror -fdata-sections -ffunction-sections ifeq ($(DEBUG), 1) CFLAGS += -g -gdwarf-2 diff --git a/cube/User/Src/main2.c b/cube/User/Src/main2.c index 69b5cb2..cce4a54 100644 --- a/cube/User/Src/main2.c +++ b/cube/User/Src/main2.c @@ -35,6 +35,7 @@ void my_setup_2() { show(LED_RED, OFF); show(LED_GREEN, BLINK); logMsg("Application starting"); + logMsg("Version: " VERSION); eepromInit();