From: Gerhard Sittig Date: Fri, 17 Mar 2017 19:28:59 +0000 (+0100) Subject: onewire_network: Fixup start samplenumber for annotations X-Git-Url: http://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=730e07bca67df0ca9f7a4e68dff87d91d0316be9 onewire_network: Fixup start samplenumber for annotations Annotations generated by the onewire_network decoder started where bit 1 began, while it should align with the start of bit 0. --- diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py index a24cb16..323da0b 100644 --- a/decoders/onewire_network/pd.py +++ b/decoders/onewire_network/pd.py @@ -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