Skip to content

Commit

Permalink
Add board/firmware versions to OD generator
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ThirteenFish committed Apr 28, 2024
1 parent af4c388 commit b93f89c
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/f0/app_adcs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f0/app_battery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f0/app_devboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f0/app_protocard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f0/app_solar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f4/app_cantest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f4/app_control/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/f4/app_devboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/l4/app_devboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/l4/app_devboard_cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b93f89c

Please sign in to comment.