From e62b6c2056041dce5036280f186a73feffd68d9d Mon Sep 17 00:00:00 2001 From: Dat Tran Date: Wed, 11 Sep 2024 10:16:40 -0400 Subject: [PATCH] Change bitrate range from 125kbs to 1000kbs --- python/DUELink/Can.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/DUELink/Can.py b/python/DUELink/Can.py index f20d7bb..06d27c4 100644 --- a/python/DUELink/Can.py +++ b/python/DUELink/Can.py @@ -19,13 +19,13 @@ class CanController: def __init__(self, serialPort:SerialInterface): self.serialPort = serialPort - def Initialize(self, baudrate): + def Initialize(self, bitrate): baudrate_string = "" - if (baudrate == 100_000 or baudrate == 250_000 or baudrate == 500_000 or baudrate == 1000_000): - baudrate_string = str(baudrate) + if (bitrate == 125_000 or bitrate == 250_000 or bitrate == 500_000 or bitrate == 1000_000): + baudrate_string = str(bitrate) else: - raise ValueError('baudrate must be 100_000, 250_000, 500_000, 1000_000') + raise ValueError('Bit rate must be 125_000, 250_000, 500_000, 1000_000') cmd = 'caninit({})'.format(baudrate_string)