diff --git a/firmware/projects/Demo/CAN/Bar/config.yaml b/firmware/projects/Demo/CAN/Bar/config.yaml index 23f7a4e2e..2599bb986 100644 --- a/firmware/projects/Demo/CAN/Bar/config.yaml +++ b/firmware/projects/Demo/CAN/Bar/config.yaml @@ -1,6 +1,6 @@ canGen: - ourNode: bar busses: - - busName: veh + - name: veh + node: bar dbcFiles: - "../demo.dbc" diff --git a/firmware/projects/Demo/CAN/Foo/config.yaml b/firmware/projects/Demo/CAN/Foo/config.yaml index b1b143053..4ef5a0ddc 100644 --- a/firmware/projects/Demo/CAN/Foo/config.yaml +++ b/firmware/projects/Demo/CAN/Foo/config.yaml @@ -1,6 +1,6 @@ canGen: - ourNode: foo busses: - - busName: veh + - name: veh + node: foo dbcFiles: - "../demo.dbc" \ No newline at end of file diff --git a/firmware/projects/EV5/FrontController/config.yaml b/firmware/projects/EV5/FrontController/config.yaml index 56dff5a56..3ad948f65 100644 --- a/firmware/projects/EV5/FrontController/config.yaml +++ b/firmware/projects/EV5/FrontController/config.yaml @@ -1,7 +1,8 @@ canGen: - ourNode: fc busses: - - busName: veh + - name: veh + node: fc dbcFile: "../veh.dbc" - - busName: pt + - name: pt + node: fc dbcFile: "../pt.dbc" diff --git a/firmware/projects/EV5/LVController/config.yaml b/firmware/projects/EV5/LVController/config.yaml index 325701615..187420ce3 100644 --- a/firmware/projects/EV5/LVController/config.yaml +++ b/firmware/projects/EV5/LVController/config.yaml @@ -1,5 +1,5 @@ canGen: - ourNode: lvc busses: - - busName: veh + - name: veh + node: lvc dbcFile: "../veh.dbc" \ No newline at end of file diff --git a/firmware/projects/EV5/TMS/config.yaml b/firmware/projects/EV5/TMS/config.yaml index 8ff0acebd..4e9f70c6d 100644 --- a/firmware/projects/EV5/TMS/config.yaml +++ b/firmware/projects/EV5/TMS/config.yaml @@ -1,5 +1,5 @@ canGen: - ourNode: tms busses: - - busName: veh + - name: veh + node: tms dbcFile: "../veh.dbc" \ No newline at end of file diff --git a/firmware/projects/EV5/debug/FrontControllerSimple/config.yaml b/firmware/projects/EV5/debug/FrontControllerSimple/config.yaml index 5e933b995..0f3b27531 100644 --- a/firmware/projects/EV5/debug/FrontControllerSimple/config.yaml +++ b/firmware/projects/EV5/debug/FrontControllerSimple/config.yaml @@ -1,7 +1,8 @@ canGen: - ourNode: fc busses: - - busName: veh + - name: veh + node: fc dbcFile: "../../veh.dbc" - - busName: pt + - name: pt + node: fc dbcFile: "../../pt.dbc" diff --git a/firmware/projects/EV5/debug/IoCheckoutFc/config.yaml b/firmware/projects/EV5/debug/IoCheckoutFc/config.yaml index 0a47cb787..c273590ff 100644 --- a/firmware/projects/EV5/debug/IoCheckoutFc/config.yaml +++ b/firmware/projects/EV5/debug/IoCheckoutFc/config.yaml @@ -1,5 +1,5 @@ canGen: - ourNode: FC busses: - - busName: io + - name: io + node: FC dbcFile: "io.dbc" diff --git a/firmware/projects/EV5/debug/MotorDebug/config.yaml b/firmware/projects/EV5/debug/MotorDebug/config.yaml index 666201815..4e37a4191 100644 --- a/firmware/projects/EV5/debug/MotorDebug/config.yaml +++ b/firmware/projects/EV5/debug/MotorDebug/config.yaml @@ -1,5 +1,5 @@ canGen: - ourNode: FRONTCONTROLLER busses: - - busName: vehicle + - name: vehicle + node: FRONTCONTROLLER dbcFile: "pedal.dbc" diff --git a/scripts/cangen/cangen/can_generator.py b/scripts/cangen/cangen/can_generator.py index 265b94ec3..548bd5ae1 100644 --- a/scripts/cangen/cangen/can_generator.py +++ b/scripts/cangen/cangen/can_generator.py @@ -216,7 +216,7 @@ def generate_code(bus: Bus, config: Config): logger.info("Generating code") can_db = _parse_dbc_files(bus.dbc_file_path) - rx_msgs, tx_msgs = _filter_messages_by_node(can_db.messages, config.node) + rx_msgs, tx_msgs = _filter_messages_by_node(can_db.messages, bus.node) context = { "date": time.strftime("%Y-%m-%d"), diff --git a/scripts/cangen/cangen/config.py b/scripts/cangen/cangen/config.py index f5394697c..4025202b3 100644 --- a/scripts/cangen/cangen/config.py +++ b/scripts/cangen/cangen/config.py @@ -7,7 +7,8 @@ class Bus: def __init__(self, bus: dict): self.dbc_file_path: str = bus.pop("dbcFile") - self.bus_name: str = bus.pop("busName").capitalize() + self.bus_name: str = bus.pop("name").capitalize() + self.node = bus.pop("node") if bus: raise ValueError( @@ -23,9 +24,7 @@ def from_yaml(config_file_name: str) -> Config: return Config(config.pop("canGen")) def __init__(self, config: dict): - self.node = config.pop("ourNode") self.output_dir = config.pop("outputPath", DEFAULT_OUTPUT_DIR) - self.busses = [Bus(bus) for bus in config.pop("busses")] if config: