commaai / opendbc

democratize access to car decoder rings
MIT License
1.81k stars 1.07k forks source link

CANPacker: fix incorrect `counters` assignment #1047

Closed deanlee closed 1 month ago

deanlee commented 1 month ago

Fix multiple counters assignments when COUNTER is not the last signal.

For example, counters[address]could be incorrectly set to the 'SIGNED' value (1) in make_can_msg():

 msg = packer.make_can_msg("CAN_FD_MESSAGE", 0, {
        "COUNTER": 10,
        "SIGNED" : 1,
      })