diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-10-13 17:05:07 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-10-13 17:07:14 +0200 |
commit | 486b19ce017c6663be6574dacd0c823304903bca (patch) | |
tree | 3c447933be4e4793cc0c26993cf294f3575ef4cd /decoders/i2s | |
parent | 95d11271b46a46788d497481d03177e883c8554e (diff) | |
download | libsigrokdecode-486b19ce017c6663be6574dacd0c823304903bca.tar.gz libsigrokdecode-486b19ce017c6663be6574dacd0c823304903bca.zip |
All PDs: More consistent names for ss/es variables.
Use self.ss/self.es, or if there's a need to differentiate
them a bit more, use self.ss_<suffix>/self.es_<suffix> consistently.
Also, drop some unused variables.
Diffstat (limited to 'decoders/i2s')
-rw-r--r-- | decoders/i2s/pd.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/decoders/i2s/pd.py b/decoders/i2s/pd.py index 8b45a75..ee642d7 100644 --- a/decoders/i2s/pd.py +++ b/decoders/i2s/pd.py @@ -67,7 +67,7 @@ class Decoder(srd.Decoder): self.data = 0 self.samplesreceived = 0 self.first_sample = None - self.start_sample = None + self.ss_block = None self.wordlength = -1 self.wrote_wav_header = False @@ -81,23 +81,23 @@ class Decoder(srd.Decoder): self.samplerate = value def putpb(self, data): - self.put(self.start_sample, self.samplenum, self.out_python, data) + self.put(self.ss_block, self.samplenum, self.out_python, data) def putbin(self, data): - self.put(self.start_sample, self.samplenum, self.out_bin, data) + self.put(self.ss_block, self.samplenum, self.out_bin, data) def putb(self, data): - self.put(self.start_sample, self.samplenum, self.out_ann, data) + self.put(self.ss_block, self.samplenum, self.out_ann, data) def report(self): # Calculate the sample rate. samplerate = '?' - if self.start_sample is not None and \ + if self.ss_block is not None and \ self.first_sample is not None and \ - self.start_sample > self.first_sample: + self.ss_block > self.first_sample: samplerate = '%d' % (self.samplesreceived * - self.samplerate / (self.start_sample - + self.samplerate / (self.ss_block - self.first_sample)) return 'I²S: %d %d-bit samples received at %sHz' % \ @@ -151,7 +151,7 @@ class Decoder(srd.Decoder): continue # Only submit the sample, if we received the beginning of it. - if self.start_sample is not None: + if self.ss_block is not None: if not self.wrote_wav_header: self.put(0, 0, self.out_bin, (0, self.wav_header())) @@ -179,7 +179,7 @@ class Decoder(srd.Decoder): # Reset decoder state. self.data = 0 self.bitcount = 0 - self.start_sample = self.samplenum + self.ss_block = self.samplenum # Save the first sample position. if self.first_sample is None: |