]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/ds1307/pd.py
x2444m: Make each command an extra annotation class.
[libsigrokdecode.git] / decoders / ds1307 / pd.py
index cb5fc13207647582cac86b2fb6ae0adc62147e0e..414da6531c31998977dab755af66dd3ce421257e 100644 (file)
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
 import re
 import sigrokdecode as srd
-from srdhelper import bcd2int
+from common.srdhelper import bcd2int
 
 days_of_week = (
     'Sunday', 'Monday', 'Tuesday', 'Wednesday',
@@ -53,7 +52,7 @@ def regs_and_bits():
     return tuple(l)
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'ds1307'
     name = 'DS1307'
     longname = 'Dallas DS1307'
@@ -75,7 +74,10 @@ class Decoder(srd.Decoder):
         ('warnings', 'Warnings', (28,)),
     )
 
-    def __init__(self, **kwargs):
+    def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.state = 'IDLE'
         self.hours = -1
         self.minutes = -1