add: log build information including commit branch, hash, and compile date

This commit is contained in:
Kilian Bracher 2025-03-04 17:24:02 +01:00
parent a249064059
commit 983c8b1e2f
2 changed files with 5 additions and 0 deletions

View File

@ -97,6 +97,7 @@ int main(void)
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
debug_clear_console();
debug_log(LOG_LEVEL_INFO, "AMS_Master on %s (%s), compiled at %s", COMMIT_BRANCH, COMMIT_HASH, COMPILE_DATE);
debug_log(LOG_LEVEL_INFO, "Starting BMS...");
int status = -1;
while (status != ADBMS_NO_ERROR) {

View File

@ -24,6 +24,9 @@ cDefinitions:
- STM32H7
- USE_HAL_DRIVER
- FTCAN_NUM_FILTERS=20
- COMMIT_HASH='"$(shell git describe --always --dirty --abbrev=8)"'
- COMMIT_BRANCH='"$(shell git rev-parse --abbrev-ref HEAD)"'
- COMPILE_DATE='"$(shell date +'%Y-%m-%d %H:%M:%S')"'
cxxDefinitions: []
asDefinitions: []
@ -40,6 +43,7 @@ asDefinitionsFile:
cFlags:
- -Wall
- -Wextra
- -Wshadow
- -fdata-sections
- -ffunction-sections
- -std=gnu23