From dfd592fc371706594917f0e2fcf115ec54269d4a Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Sun, 7 Apr 2019 16:15:43 +0200 Subject: [PATCH] [CODE] add build info (git commit) to info line --- .gitignore | 4 ++++ main/component.mk | 3 +++ main/esp32-sensornode_main.cpp | 12 +++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 45885ee..2d31794 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ components/ # KiCAD EDA *.bak *.kicad_pcb-bak + +# VS Code +.vscode/arduino.json +.vscode/c_cpp_properties.json diff --git a/main/component.mk b/main/component.mk index 0b9d758..1fbedc2 100644 --- a/main/component.mk +++ b/main/component.mk @@ -3,3 +3,6 @@ # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) +PROJ_GIT_VER := $(shell git describe --always --tags --dirty) + +CPPFLAGS += -D PROJ_VER=\"$(PROJ_GIT_VER)\" diff --git a/main/esp32-sensornode_main.cpp b/main/esp32-sensornode_main.cpp index d43b36c..fbbe0b8 100644 --- a/main/esp32-sensornode_main.cpp +++ b/main/esp32-sensornode_main.cpp @@ -28,7 +28,7 @@ #endif #ifndef BOARD -#define BOARD 0 /* IMPORTANT: select one of the BOARD_* types */ +#define BOARD 4 /* IMPORTANT: select one of the BOARD_* types */ #endif #define DB_HOSTNAME "ursaminor.fra80" @@ -176,12 +176,14 @@ extern "C" void app_main() { delay(100); Serial.println(""); - Serial.print("[INFO ] Node "); + Serial.print("[INFO ] Type "); + Serial.print(BOARD); + Serial.print(", Node: "); Serial.print(loggerId); - Serial.print(", Name: "); + Serial.print(" ("); Serial.print(loggerName); - Serial.print(", BoardType: "); - Serial.println(BOARD); + Serial.print("), Build: "); + Serial.println(PROJ_VER); #endif #ifdef PRINT_DEBUG printWakeupReason();