bit = 0
while True:
# TODO: Come up with more appropriate self.wait() conditions.
- (dali,) = self.wait({'skip': 1})
+ (dali,) = self.wait()
if self.options['polarity'] == 'active-high':
dali ^= 1 # Invert.
# Mark and read a single transmitted byte
# (start bit, 8 data bits, 2 stop bits).
elif self.state == 'READ BYTE':
- (dmx,) = self.wait({'skip': 1})
+ (dmx,) = self.wait()
self.next_sample = self.run_start + (self.bit + 1) * self.skip_per_bit
self.aggreg += dmx
if self.samplenum != self.next_sample:
raise SamplerateError('Cannot decode without samplerate.')
bit = 0
while True:
- (self.dsi,) = self.wait({'skip': 1})
+ (self.dsi,) = self.wait()
if self.options['polarity'] == 'active-high':
self.dsi ^= 1 # Invert.
raise SamplerateError('Cannot decode without samplerate.')
# Initialize internal state from the very first sample.
- (pin,) = self.wait({'skip': 1})
+ (pin,) = self.wait()
self.oldpin = pin
self.last_samplenum = self.samplenum
self.lastlast_samplenum = self.samplenum
raise SamplerateError('Cannot decode without samplerate.')
while True:
- (self.ir,) = self.wait({'skip': 1})
+ (self.ir,) = self.wait()
# Wait for any edge (rising or falling).
if self.old_ir == self.ir:
def decode(self):
while True:
# TODO: Come up with more appropriate self.wait() conditions.
- pins = self.wait({'skip': 1})
+ pins = self.wait()
# If none of the pins changed, there's nothing to do.
if self.oldpins == pins:
if not self.samplerate:
raise SamplerateError('Cannot decode without samplerate.')
- (qi,) = self.wait({'skip': 1})
+ (qi,) = self.wait()
self.handle_transition(self.samplenum, qi == 0)
while True:
prev = self.samplenum
while True:
# TODO: Come up with more appropriate self.wait() conditions.
- (pin,) = self.wait({'skip': 1})
+ (pin,) = self.wait()
if self.oldpin is None:
self.oldpin = pin
raise SamplerateError('Cannot decode without samplerate.')
# Seed internal state from the very first sample.
- pins = self.wait({'skip': 1})
+ pins = self.wait()
sym = symbols[self.options['signalling']][pins]
self.handle_idle(sym)
self.get_eop(sym)
elif self.state == 'WAIT IDLE':
# Skip "all-low" input. Wait for high level on either DP or DM.
- pins = self.wait({'skip': 1})
+ pins = self.wait()
while not pins[0] and not pins[1]:
pins = self.wait([{0: 'h'}, {1: 'h'}])
if self.samplenum - self.samplenum_lastedge > 1:
def decode(self):
while True:
# TODO: Come up with more appropriate self.wait() conditions.
- (d0, d1) = self.wait({'skip': 1})
+ (d0, d1) = self.wait()
if d0 == self._d0_prev and d1 == self._d1_prev:
if self.es_bit and self.samplenum >= self.es_bit:
def decode(self):
while True:
# TODO: Come up with more appropriate self.wait() conditions.
- pins = self.wait({'skip': 1})
+ pins = self.wait()
cycle = Cycle.NONE
if pins[Pin.MREQ] != 1: # default to asserted
if pins[Pin.RD] == 0: