diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2017-02-20 20:58:09 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-12-22 12:18:13 +0100 |
commit | 779c540dfa3780f3bb61ad46f28801952d5d190b (patch) | |
tree | 9367bc27979163c50d9d60a5ca7313caa35949ee /decoders | |
parent | 0f4d88071202e6eeb717ce90896cda12a06d336b (diff) | |
download | libsigrokdecode-779c540dfa3780f3bb61ad46f28801952d5d190b.tar.gz libsigrokdecode-779c540dfa3780f3bb61ad46f28801952d5d190b.zip |
am230x: rename reset() helper method
The am230x decoder implements a reset() method which clears internal
decoder state. Rename the method before all decoders will grow a new
reset() method that will be used for a different purpose.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/am230x/pd.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/decoders/am230x/pd.py b/decoders/am230x/pd.py index 3c5003d..0e4eac8 100644 --- a/decoders/am230x/pd.py +++ b/decoders/am230x/pd.py @@ -74,7 +74,7 @@ class Decoder(srd.Decoder): def putv(self, data): self.put(self.bytepos[-2], self.samplenum, self.out_ann, data) - def reset(self): + def reset_variables(self): self.state = 'WAIT FOR START LOW' self.fall = 0 self.rise = 0 @@ -123,7 +123,7 @@ class Decoder(srd.Decoder): def __init__(self): self.samplerate = None - self.reset() + self.reset_variables() def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) @@ -177,7 +177,7 @@ class Decoder(srd.Decoder): self.rise = self.samplenum self.state = 'WAIT FOR RESPONSE LOW' else: - self.reset() + self.reset_variables() elif self.state == 'WAIT FOR RESPONSE LOW': self.wait({0: 'f'}) if self.is_valid('START HIGH'): @@ -185,14 +185,14 @@ class Decoder(srd.Decoder): self.fall = self.samplenum self.state = 'WAIT FOR RESPONSE HIGH' else: - self.reset() + self.reset_variables() elif self.state == 'WAIT FOR RESPONSE HIGH': self.wait({0: 'r'}) if self.is_valid('RESPONSE LOW'): self.rise = self.samplenum self.state = 'WAIT FOR FIRST BIT' else: - self.reset() + self.reset_variables() elif self.state == 'WAIT FOR FIRST BIT': self.wait({0: 'f'}) if self.is_valid('RESPONSE HIGH'): @@ -201,14 +201,14 @@ class Decoder(srd.Decoder): self.bytepos.append(self.samplenum) self.state = 'WAIT FOR BIT HIGH' else: - self.reset() + self.reset_variables() elif self.state == 'WAIT FOR BIT HIGH': self.wait({0: 'r'}) if self.is_valid('BIT LOW'): self.rise = self.samplenum self.state = 'WAIT FOR BIT LOW' else: - self.reset() + self.reset_variables() elif self.state == 'WAIT FOR BIT LOW': self.wait({0: 'f'}) if self.is_valid('BIT 0 HIGH'): @@ -216,10 +216,10 @@ class Decoder(srd.Decoder): elif self.is_valid('BIT 1 HIGH'): bit = 1 else: - self.reset() + self.reset_variables() continue self.handle_byte(bit) elif self.state == 'WAIT FOR END': self.wait({0: 'r'}) self.putfs([3, ['End', 'E']]) - self.reset() + self.reset_variables() |