Skip to content

Commit

Permalink
Merge pull request #28 from oresat/fw-versions
Browse files Browse the repository at this point in the history
Externally defined hardware and firmware versions in OD
  • Loading branch information
ryanpdx authored Apr 28, 2024
2 parents ed57c77 + aba892c commit ff1b421
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions oresat_configs/scripts/gen_fw_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def build_parser(parser: ArgumentParser) -> ArgumentParser:
"card", help="card name; c3, battery, solar, adcs, reaction_wheel, or diode_test"
)
parser.add_argument("-d", "--dir-path", default=".", help='output directory path, default: "."')
parser.add_argument(
"-hw", "--hardware-version", help="hardware board version string, usually defined in make"
)
parser.add_argument(
"-fw", "--firmware-version", help="firmware version string, usually git describe output"
)
return parser


Expand Down Expand Up @@ -698,4 +704,9 @@ def gen_fw_files(args: Optional[Namespace] = None) -> None:
print(f"invalid oresat card: {args.card}")
sys.exit()

if args.hardware_version is not None:
od["versions"]["hw_version"].default = args.hardware_version
if args.firmware_version is not None:
od["versions"]["fw_version"].default = args.firmware_version

write_canopennode(od, args.dir_path)

0 comments on commit ff1b421

Please sign in to comment.