]> sigrok.org Git - libsigrokdecode.git/commitdiff
onewire_network: Fixup start samplenumber for annotations
authorGerhard Sittig <redacted>
Fri, 17 Mar 2017 19:28:59 +0000 (20:28 +0100)
committerUwe Hermann <redacted>
Wed, 21 Jun 2017 15:45:15 +0000 (17:45 +0200)
Annotations generated by the onewire_network decoder started where bit 1
began, while it should align with the start of bit 0.

decoders/onewire_network/pd.py

index a24cb1655c52591121f5b3afb59509b1de2174b2..323da0b6e580c85aed13bc6f08620a78f5c700e5 100644 (file)
@@ -129,7 +129,7 @@ class Decoder(srd.Decoder):
     # Data collector.
     def onewire_collect(self, length, val, ss, es):
         # Storing the sample this sequence begins with.
-        if self.bit_cnt == 1:
+        if self.bit_cnt == 0:
             self.ss_block = ss
         self.data = self.data & ~(1 << self.bit_cnt) | (val << self.bit_cnt)
         self.bit_cnt += 1