]> sigrok.org Git - libsigrokdecode.git/commitdiff
ntf905: Add/rename required self.reset() method.
authorUwe Hermann <redacted>
Tue, 26 May 2020 18:57:50 +0000 (20:57 +0200)
committerUwe Hermann <redacted>
Tue, 26 May 2020 19:54:04 +0000 (21:54 +0200)
decoders/nrf905/pd.py

index 4771314746e700de871a188e00cc37d9a73b8e0d..076fbeddd8478a27174c8ec0b13268dfc87a4f4e 100644 (file)
@@ -111,14 +111,14 @@ class Decoder(srd.Decoder):
         ('warnings', 'Warnings', (ann_warn,))
     )
 
-    def reset_data(self):
-        self.mosi_bytes, self.miso_bytes = [], []
-        self.cmd_samples = {'ss': 0, 'es': 0}
-
     def __init__(self):
         self.ss_cmd, self.es_cmd = 0, 0
         self.cs_asserted = False
-        self.reset_data()
+        self.reset()
+
+    def reset(self):
+        self.mosi_bytes, self.miso_bytes = [], []
+        self.cmd_samples = {'ss': 0, 'es': 0}
 
     def start(self):
         self.out_ann = self.register(srd.OUTPUT_ANN)
@@ -338,7 +338,7 @@ class Decoder(srd.Decoder):
                 self.set_cs_status(ss, False)
                 if len(self.mosi_bytes):
                     self.process_cmd()
-                    self.reset_data()
+                    self.reset()
 
         elif ptype == 'DATA':
             # Ignore traffic if CS is not asserted.