From 597286d307711b4e2b75c8759fe22ab19e8166a3 Mon Sep 17 00:00:00 2001 From: Damien Gaignon Date: Fri, 18 Nov 2022 22:59:04 +0100 Subject: [PATCH] Add commit sha to firmware string --- Firmware/base.h | 4 +++- Firmware/busPirate.X/Makefile | 1 + Firmware/busPirate.X/nbproject/configurations.xml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Firmware/base.h b/Firmware/base.h index 74156095..01d68148 100644 --- a/Firmware/base.h +++ b/Firmware/base.h @@ -44,7 +44,9 @@ /** * @brief Firmware version string, used at startup and for the 'i' command. */ -#define BP_FIRMWARE_STRING "Community Firmware v7.1 - goo.gl/gCzQnW " +#define _STRINGIFY(x) #x +#define STRINGIFY(x) _STRINGIFY(x) +#define BP_FIRMWARE_STRING "Community Firmware v7.1 - goo.gl/gCzQnW - " STRINGIFY(VERSION) " \r\n" /** * @brief Current mode configuration settings structure. diff --git a/Firmware/busPirate.X/Makefile b/Firmware/busPirate.X/Makefile index 5edcb792..a7694cd2 100644 --- a/Firmware/busPirate.X/Makefile +++ b/Firmware/busPirate.X/Makefile @@ -55,6 +55,7 @@ build: .build-post .build-pre: # Add your pre 'build' code here... +VERSION:=${shell git rev-parse --short HEAD} .build-post: .build-impl # Add your post 'build' code here... diff --git a/Firmware/busPirate.X/nbproject/configurations.xml b/Firmware/busPirate.X/nbproject/configurations.xml index 159bb302..b063c694 100644 --- a/Firmware/busPirate.X/nbproject/configurations.xml +++ b/Firmware/busPirate.X/nbproject/configurations.xml @@ -314,7 +314,7 @@ - +