Skip to content

Commit

Permalink
fix dcf generator to write bool values as 0/1
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Jan 5, 2025
1 parent ba6118a commit 9c571f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oresat_configs/scripts/gen_dcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def _variable_lines(variable: Variable, index: int, subindex: Optional[int] = No
if variable.data_type == canopen.objectdictionary.OCTET_STRING:
tmp = variable.default.hex(sep=" ")
lines.append(f"DefaultValue={tmp}")
elif variable.data_type == canopen.objectdictionary.BOOLEAN:
lines.append(f"DefaultValue={int(variable.default)}")
else:
lines.append(f"DefaultValue={variable.default}")
if variable.pdo_mappable: # optional
Expand Down

0 comments on commit 9c571f3

Please sign in to comment.