]> sigrok.org Git - libsigrokdecode.git/commitdiff
st7735: Merge reset_state() into reset().
authorUwe Hermann <redacted>
Sun, 13 May 2018 16:28:05 +0000 (18:28 +0200)
committerUwe Hermann <redacted>
Sun, 13 May 2018 16:31:43 +0000 (18:31 +0200)
decoders/st7735/pd.py

index f704c03a6f396840dec9bd042885d0e0aecdb23c..999038a3a18b7178b8747a52d9f8e85460f08abb 100644 (file)
@@ -95,18 +95,15 @@ class Decoder(srd.Decoder):
         self.reset()
 
     def reset(self):
-        pass
-
-    def start(self):
-        self.out_ann = self.register(srd.OUTPUT_ANN)
-
-    def reset_state(self):
         self.accum_byte = 0
         self.accum_bits_num = 0
         self.bit_ss = -1
         self.byte_ss = -1
         self.current_bit = -1
 
+    def start(self):
+        self.out_ann = self.register(srd.OUTPUT_ANN)
+
     def put_desc(self, ss, es, cmd, data):
         if cmd == -1:
             return
@@ -130,13 +127,13 @@ class Decoder(srd.Decoder):
         current_data = []
         desc_ss = -1
         desc_es = -1
-        self.reset_state()
+        self.reset()
         while True:
             # Check data on both CLK edges.
             (cs, clk, mosi, dc) = self.wait({1: 'e'})
 
             if cs == 1: # Wait for CS = low, ignore the rest.
-                self.reset_state()
+                self.reset()
                 continue
 
             if clk == 1: