]> sigrok.org Git - libsigrokdecode.git/commitdiff
mrf24j40: rename reset() helper method
authorGerhard Sittig <redacted>
Fri, 22 Dec 2017 02:54:21 +0000 (03:54 +0100)
committerUwe Hermann <redacted>
Fri, 22 Dec 2017 11:18:13 +0000 (12:18 +0100)
The mrf24j40 decoder implements a reset() method which clears internally
accumulated data during decoding. Rename the method before all decoders
will grow a new reset() method that will be used for a different purpose.

decoders/mrf24j40/pd.py

index a91e765fe0d71e0ac071f7410edca69dfaffafa1..e195b18f327354b0dd1240e3453822557682a996 100644 (file)
@@ -56,7 +56,7 @@ class Decoder(srd.Decoder):
     def putw(self, pos, msg):
         self.put(pos[0], pos[1], self.out_ann, [4, [msg]])
 
-    def reset(self):
+    def reset_data(self):
         self.mosi_bytes = []
         self.miso_bytes = []
 
@@ -103,7 +103,7 @@ class Decoder(srd.Decoder):
             if cs_old is not None and cs_old == 0 and cs_new == 1:
                 if len(self.mosi_bytes) not in (0, 2, 3):
                     self.putw([self.ss_cmd, es], 'Misplaced CS!')
-                    self.reset()
+                    self.reset_data()
             return
 
         # Don't care about anything else.
@@ -126,8 +126,8 @@ class Decoder(srd.Decoder):
             if len(self.mosi_bytes) == 3:
                 self.es_cmd = es
                 self.handle_long()
-                self.reset()
+                self.reset_data()
         else:
             self.es_cmd = es
             self.handle_short()
-            self.reset()
+            self.reset_data()