Skip to content

Commit

Permalink
Change bitrate range from 125kbs to 1000kbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Palomino34 committed Sep 11, 2024
1 parent a68b3ee commit e62b6c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/DUELink/Can.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e62b6c2

Please sign in to comment.