- self.bit = owr & 0x1
- if (self.bit): self.state = 'WAIT FOR FALLING EDGE'
- else : self.state = 'WAIT FOR RISING EDGE'
- self.put(self.fall, self.cnt_bit[self.overdrive], self.out_ann, [0, ['BIT: %01x' % self.bit]])
- self.put(self.fall, self.cnt_bit[self.overdrive], self.out_proto, ['BIT', self.bit])
- # Checking the first command to see if overdrive mode should be entered
- if (self.bit_cnt <= 8):
- self.command = self.command | (self.bit << self.bit_cnt)
- elif (self.bit_cnt == 8):
- if (self.command in [0x3c, 0x69]):
- self.put(self.fall, self.cnt_bit[self.overdrive], self.out_ann, [0, ['ENTER OVERDRIVE MODE']])
- # incrementing the bit counter
- self.bit_cnt += 1
+ self.bit = owr
+ self.state = 'WAIT FOR DATA SLOT END'
+ elif self.state == 'WAIT FOR DATA SLOT END':
+ # A data slot ends in a recovery period, otherwise, this is probably a reset
+ if (self.samplenum - self.fall == self.cnt_slot[self.overdrive]):
+ if (owr):
+ self.put(self.fall, self.samplenum, self.out_ann, [0, ['BIT: %01x' % self.bit]])
+ self.put(self.fall, self.samplenum, self.out_proto, ['BIT', self.bit])
+ # Checking the first command to see if overdrive mode should be entered
+ if (self.bit_cnt <= 8):
+ self.command = self.command | (self.bit << self.bit_cnt)
+ elif (self.bit_cnt == 8):
+ if (self.command in [0x3c, 0x69]):
+ self.put(self.fall, self.cnt_bit[self.overdrive], self.out_ann, [0, ['ENTER OVERDRIVE MODE']])
+ # Incrementing the bit counter
+ self.bit_cnt += 1
+ # Wait for next slot
+ self.state = 'WAIT FOR FALLING EDGE'
+ else:
+ # This seems to be a reset slot, wait for its end
+ self.state = 'WAIT FOR RISING EDGE'