From 9c571f3c3bcc2dc3fa982456363ba5ff0ab41436 Mon Sep 17 00:00:00 2001 From: Ryan Medick Date: Sun, 5 Jan 2025 09:59:37 -0800 Subject: [PATCH] fix dcf generator to write bool values as 0/1 --- oresat_configs/scripts/gen_dcf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oresat_configs/scripts/gen_dcf.py b/oresat_configs/scripts/gen_dcf.py index ad982f8..fdea9d6 100644 --- a/oresat_configs/scripts/gen_dcf.py +++ b/oresat_configs/scripts/gen_dcf.py @@ -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