Skip to content

Commit

Permalink
V1.19.05
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyates committed Jan 2, 2025
1 parent 584a805 commit 498e39d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions genmonlib/myserial.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@ def __init__(
else:
self.SerialDevice.bytesize = serial.EIGHTBITS

if Parity == None or Parity == 0 or Parity.lower() == "none":
if isinstance(Parity,str):
if Parity.lower() == "none":
Parity = 0
elif Parity.lower() == "odd":
Parity = 1
else:
Parity = 0

if Parity == None or Parity == 0:
# set parity check: no parity
self.SerialDevice.parity = (serial.PARITY_NONE)
elif Parity == 1 or Parity.lower() == "odd":
elif Parity == 1:
# set parity check: use odd parity
self.SerialDevice.parity = (serial.PARITY_ODD)
self.LogError("Serial: Setting ODD parity")
Expand Down

0 comments on commit 498e39d

Please sign in to comment.