Skip to content

Commit

Permalink
Change Firmware Revision string to Git commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Aug 28, 2024
1 parent c6b0733 commit 6b51fc3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions software/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ID_FLASH_LOCATION = 0x001FFFF8

DEFINES = -D_HW_REVISION=$(REVISION)
DEFINES += -D_DATETIME="\"$(shell date -u)\""
DEFINES += -D_FW_REVISION=$(shell cd ../.. && git log --pretty=format:'%h' -n 1)
DEFINES += -DPART_$(PART)
DEFINES += -D$(PART_DEF)
DEFINES += -D'SEGGER_RTT_SECTION="SHARED_RW"'
Expand Down
1 change: 1 addition & 0 deletions software/firmware/src/app/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef enum { BATTERY_EMPTY = 3500, BATTERY_CRITICAL = 3680, BATTERY_NOMINAL =
#define MANUFACTURER "Lab11"
#define HW_MODEL "TotTag"
#define HW_REVISION "Rev. "STRINGIZE_VAL(_HW_REVISION)
#define FW_REVISION "Commit "STRINGIZE_VAL(_FW_REVISION)

#define MAX_NUM_CONNECTIONS 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const uint8_t deviceInfoModelNum[] = HW_MODEL;
static const uint16_t deviceInfoModelNumLen = sizeof(deviceInfoModelNum);
static const uint8_t deviceInfoFirmwareVerChar[] = { ATT_PROP_READ, UINT16_TO_BYTES(DEVICE_INFO_FIRMWARE_VER_HANDLE), UINT16_TO_BYTES(ATT_UUID_FIRMWARE_REV) };
static const uint16_t deviceInfoFirmwareVerCharLen = sizeof(deviceInfoFirmwareVerChar);
static const uint8_t deviceInfoFirmwareVer[] = __DATE__;
static const uint8_t deviceInfoFirmwareVer[] = FW_REVISION;
static const uint16_t deviceInfoFirmwareVerLen = sizeof(deviceInfoFirmwareVer);
static const uint8_t deviceInfoHardwareVerChar[] = { ATT_PROP_READ, UINT16_TO_BYTES(DEVICE_INFO_HARDWARE_VER_HANDLE), UINT16_TO_BYTES(ATT_UUID_HARDWARE_REV) };
static const uint16_t deviceInfoHardwareVerCharLen = sizeof(deviceInfoHardwareVerChar);
Expand Down
1 change: 1 addition & 0 deletions software/firmware/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ID_FLASH_LOCATION = 0x001FFFF8

DEFINES = -D_HW_REVISION=$(REVISION)
DEFINES += -D_DATETIME="\"$(shell date -u)\""
DEFINES += -D_FW_REVISION=$(shell cd ../../.. && git log --pretty=format:'%h' -n 1)
DEFINES += -DPART_$(PART)
DEFINES += -D$(PART_DEF)
DEFINES += -D'SEGGER_RTT_SECTION="SHARED_RW"'
Expand Down

0 comments on commit 6b51fc3

Please sign in to comment.