diff --git a/decoders/i2s/pd.py b/decoders/i2s/pd.py index bfb2c9e9..e32fe6f7 100644 --- a/decoders/i2s/pd.py +++ b/decoders/i2s/pd.py @@ -145,10 +145,12 @@ def decode(self): self.samplesreceived += 1 - idx = 0 if self.oldws else 1 - c1 = 'Left channel' if self.oldws else 'Right channel' - c2 = 'Left' if self.oldws else 'Right' - c3 = 'L' if self.oldws else 'R' + sck = self.wait({0: 'f'}) + + idx = 0 if not self.oldws else 1 + c1 = 'Left channel' if not self.oldws else 'Right channel' + c2 = 'Left' if not self.oldws else 'Right' + c3 = 'L' if not self.oldws else 'R' v = '%08x' % self.data self.putpb(['DATA', [c3, self.data]]) self.putb([idx, ['%s: %s' % (c1, v), '%s: %s' % (c2, v), @@ -161,6 +163,8 @@ def decode(self): 'word' % (self.bitcount, self.wordlength)]]) self.wordlength = self.bitcount + else: + sck = self.wait({0: 'f'}) # Reset decoder state. self.data = 0