When the UART frame does not contain a parity bit, then immediately
advance to reception of stop bits after all data bits were received.
This eliminates the necessity to run the parity check routine when
parity does not apply in the first place. Without this change, some
"dummy" sample needs to get inspected for correct operation of the
state machine.
self.cur_data_bit[rxtx] += 1
return
self.cur_data_bit[rxtx] += 1
return
+ # Skip to either reception of the parity bit, or reception of
+ # the STOP bits if parity is not applicable.
self.state[rxtx] = 'GET PARITY BIT'
self.state[rxtx] = 'GET PARITY BIT'
+ if self.options['parity_type'] == 'none':
+ self.state[rxtx] = 'GET STOP BITS'
self.putpx(rxtx, ['DATA', rxtx,
(self.datavalue[rxtx], self.databits[rxtx])])
self.putpx(rxtx, ['DATA', rxtx,
(self.datavalue[rxtx], self.databits[rxtx])])
return None
def get_parity_bit(self, rxtx, signal):
return None
def get_parity_bit(self, rxtx, signal):
- # If no parity is used/configured, skip to the next state immediately.
- if self.options['parity_type'] == 'none':
- self.state[rxtx] = 'GET STOP BITS'
- return
-
# Skip samples until we're in the middle of the parity bit.
if not self.reached_bit(rxtx, self.options['num_data_bits'] + 1):
return
# Skip samples until we're in the middle of the parity bit.
if not self.reached_bit(rxtx, self.options['num_data_bits'] + 1):
return