Skip to content

Commit

Permalink
fix a issue with boolean defaults in gen_fw_files script
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Oct 29, 2023
1 parent 9b6c777 commit 6d45512
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions oresat_configs/scripts/gen_fw_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,16 @@ def write_canopennode(od: canopen.ObjectDictionary, dir_path: str = "."):
def remove_node_id(default: str):
"""Remove "+$NODEID" or "$NODEID+" from the default value"""

if isinstance(default, bool):
default = int(default)
if not isinstance(default, str):
return default

temp = default.split("+")

if default == "":
return "0"

temp = default.split("+")

if len(temp) == 1:
return default # does not include $NODEID
if temp[0] == "$NODEID":
Expand Down

0 comments on commit 6d45512

Please sign in to comment.