From b93f89cd6c8da121570f2eb1b1c0bdbf2e79ad00 Mon Sep 17 00:00:00 2001 From: Theo Hill Date: Sun, 28 Apr 2024 15:22:53 -0700 Subject: [PATCH] Add board/firmware versions to OD generator This patch ensures that the board and firmware versions make it somewhere into the built artefacts. The script itself puts them into the object dictionary at the appropriate locations. The firmware version is pretty easy, it's just the output of `git describe`. As long as tags are maintained it will do the right thing. Board version is kind of nebulous, currently it just pulls the name of the board config directory in. There's not really a better string defined anywhere that I can see? Also because of the way the OD is generated it's hard to get something from inside a file like a #define so using the directory is easy to implement. --- src/f0/app_adcs/Makefile | 3 ++- src/f0/app_battery/Makefile | 3 ++- src/f0/app_devboard/Makefile | 3 ++- src/f0/app_protocard/Makefile | 3 ++- src/f0/app_solar/Makefile | 3 ++- src/f4/app_cantest/Makefile | 3 ++- src/f4/app_control/Makefile | 3 ++- src/f4/app_devboard/Makefile | 3 ++- src/l4/app_devboard/Makefile | 3 ++- src/l4/app_devboard_cpp/Makefile | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/f0/app_adcs/Makefile b/src/f0/app_adcs/Makefile index f37d0649..57fc8f31 100644 --- a/src/f0/app_adcs/Makefile +++ b/src/f0/app_adcs/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) ORESAT = 0.5 endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) imu -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) imu -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f0/app_battery/Makefile b/src/f0/app_battery/Makefile index 44a8d1ce..adaa2fba 100644 --- a/src/f0/app_battery/Makefile +++ b/src/f0/app_battery/Makefile @@ -116,7 +116,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) battery -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) battery -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f0/app_devboard/Makefile b/src/f0/app_devboard/Makefile index d7e4f6dc..89459103 100644 --- a/src/f0/app_devboard/Makefile +++ b/src/f0/app_devboard/Makefile @@ -116,7 +116,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f0/app_protocard/Makefile b/src/f0/app_protocard/Makefile index 705f6347..6151ed3b 100644 --- a/src/f0/app_protocard/Makefile +++ b/src/f0/app_protocard/Makefile @@ -116,7 +116,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f0/app_solar/Makefile b/src/f0/app_solar/Makefile index 8e4e1795..e4523198 100644 --- a/src/f0/app_solar/Makefile +++ b/src/f0/app_solar/Makefile @@ -116,7 +116,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) solar -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) solar -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f4/app_cantest/Makefile b/src/f4/app_cantest/Makefile index c5fe8c19..a215855e 100644 --- a/src/f4/app_cantest/Makefile +++ b/src/f4/app_cantest/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f4/app_control/Makefile b/src/f4/app_control/Makefile index b41c806d..9b015cca 100644 --- a/src/f4/app_control/Makefile +++ b/src/f4/app_control/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/f4/app_devboard/Makefile b/src/f4/app_devboard/Makefile index 029c6236..bbf54184 100644 --- a/src/f4/app_devboard/Makefile +++ b/src/f4/app_devboard/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/l4/app_devboard/Makefile b/src/l4/app_devboard/Makefile index e7cf2cb0..036cf0ab 100644 --- a/src/l4/app_devboard/Makefile +++ b/src/l4/app_devboard/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR) diff --git a/src/l4/app_devboard_cpp/Makefile b/src/l4/app_devboard_cpp/Makefile index aeaccb0d..cf5184eb 100644 --- a/src/l4/app_devboard_cpp/Makefile +++ b/src/l4/app_devboard_cpp/Makefile @@ -111,7 +111,8 @@ ifeq ($(ORESAT),) endif # generate OD.c/OD.h from oresat-configs -$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR)) +FW_VERSION = $(shell git describe) +$(shell oresat-gen-fw-files --oresat $(ORESAT) base -d $(ODDIR) -fw $(FW_VERSION) -hw $(BOARD)) # add them ALLCSRC += $(ODDIR)/OD.c ALLINC += $(ODDIR)