mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 09:13:52 +08:00
CAN driver cleanup (#2276)
* it's all the same thing * not live * less macro * lil more * bool * lil more
This commit is contained in:
@@ -23,7 +23,7 @@ __version__ = '0.0.10'
|
||||
CANPACKET_HEAD_SIZE = 0x6
|
||||
DLC_TO_LEN = [0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64]
|
||||
LEN_TO_DLC = {length: dlc for (dlc, length) in enumerate(DLC_TO_LEN)}
|
||||
PANDA_BUS_CNT = 3
|
||||
PANDA_CAN_CNT = 3
|
||||
|
||||
|
||||
def calculate_checksum(data):
|
||||
@@ -225,11 +225,11 @@ class Panda:
|
||||
self.can_reset_communications()
|
||||
|
||||
# disable automatic CAN-FD switching
|
||||
for bus in range(PANDA_BUS_CNT):
|
||||
for bus in range(PANDA_CAN_CNT):
|
||||
self.set_canfd_auto(bus, False)
|
||||
|
||||
# set CAN speed
|
||||
for bus in range(PANDA_BUS_CNT):
|
||||
for bus in range(PANDA_CAN_CNT):
|
||||
self.set_can_speed_kbps(bus, self._can_speed_kbps)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user