Created
December 18, 2017 18:18
-
-
Save celeron55/a951799517850dfec9a793b5247fa046 to your computer and use it in GitHub Desktop.
libsigrokdecode can crc last-bit-stuffing patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/decoders/can/pd.py b/decoders/can/pd.py | |
index 5be3e99..72fb505 100644 | |
--- a/decoders/can/pd.py | |
+++ b/decoders/can/pd.py | |
@@ -129,7 +129,7 @@ def is_stuff_bit(self): | |
# CAN uses NRZ encoding and bit stuffing. | |
# After 5 identical bits, a stuff bit of opposite value is added. | |
# But not in the CRC delimiter, ACK, and end of frame fields. | |
- if len(self.bits) > self.last_databit + 16: | |
+ if len(self.bits) > self.last_databit + 17: | |
return False | |
last_6_bits = self.rawbits[-6:] | |
if last_6_bits not in ([0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 0]): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment