diff options
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/can/pd.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/decoders/can/pd.py b/decoders/can/pd.py index 7638c2f..ffc3652 100644 --- a/decoders/can/pd.py +++ b/decoders/can/pd.py @@ -57,11 +57,11 @@ class Decoder(srd.Decoder): ('ack-delimiter', 'ACK delimiter'), ('stuff-bit', 'Stuff bit'), ('warnings', 'Human-readable warnings'), - ('bits', 'Bits'), + ('bit', 'Bit'), ) annotation_rows = ( - ('bits', 'Bits', (17,)), - ('fields', 'Fields', tuple(range(17))), + ('bits', 'Bits', (15, 17)), + ('fields', 'Fields', tuple(range(15)) + (16,)), ) def __init__(self, **kwargs): @@ -120,8 +120,6 @@ class Decoder(srd.Decoder): return False # Stuff bit. Keep it in self.rawbits, but drop it from self.bits. - self.putx([15, ['Stuff bit: %d' % self.rawbits[-1], - 'SB: %d' % self.rawbits[-1], 'SB']]) self.bits.pop() # Drop last bit. return True @@ -310,13 +308,13 @@ class Decoder(srd.Decoder): # Get the index of the current CAN frame bit (without stuff bits). bitnum = len(self.bits) - 1 - # Emit a bit value annotation. - self.putx([17, [str(can_rx)]]) - # If this is a stuff bit, remove it from self.bits and ignore it. if self.is_stuff_bit(): + self.putx([15, [str(can_rx)]]) self.curbit += 1 # Increase self.curbit (bitnum is not affected). return + else: + self.putx([17, [str(can_rx)]]) # Bit 0: Start of frame (SOF) bit if bitnum == 0: |