Added git rev to build info

This commit is contained in:
Magnus Persson
2022-03-21 21:42:44 +01:00
parent dab4d0ed22
commit 07fefe41fb
3 changed files with 11 additions and 2 deletions

View File

@ -34,6 +34,7 @@ build_flags =
-D USER_SSID=\""\"" # =\""myssid\""
-D USER_SSID_PWD=\""\"" # =\""mypwd\""
-D CFG_APPVER="\"0.9.0\""
!python script/git_rev.py
lib_deps = # Switched to forks for better version control.
# Using local copy of these libraries
#https://github.com/jrowberg/i2cdevlib.git#<document>

8
script/git_rev.py Normal file
View File

@ -0,0 +1,8 @@
import subprocess
revision = (
subprocess.check_output(["git", "rev-parse", "HEAD"])
.strip()
.decode("utf-8")
)
print("-D CFG_GITREV='\"%s\"'" % revision)

View File

@ -191,7 +191,7 @@ void deepSleep(int t) {
// Print the build options used
//
void printBuildOptions() {
Log.notice(F("Build options: %s LOGLEVEL %d "
Log.notice(F("Build options: %s (%s) LOGLEVEL %d "
#ifdef SKIP_SLEEPMODE
"SKIP_SLEEP "
#endif
@ -205,7 +205,7 @@ void printBuildOptions() {
"OTA "
#endif
CR),
CFG_APPVER, LOG_LEVEL);
CFG_APPVER, CFG_GITREV, LOG_LEVEL);
}
//