Skip to content

Commit

Permalink
Add serial port baudrate setter
Browse files Browse the repository at this point in the history
Allow serial port code to set the baud rate as well as query. Avoid
re-setting the baud rate to the current value as QtSerial seems to
do two baud rate settings, first to 4Mbaud and then to the target rate
in this case.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Nov 20, 2024
1 parent 02d4b64 commit 6c74a02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mu/modes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def baudrate(self):
else:
return None

@baudrate.setter
def baudrate(self, value):
if value != self._baudrate:
self._baudrate = value
if self.serial:
self.serial.setBaudRate(value)

def open(self):
"""
Open the serial link
Expand Down

0 comments on commit 6c74a02

Please sign in to comment.