]> sigrok.org Git - libsigrokdecode.git/commitdiff
rtc8564: Handle register 0x06 (weekday).
authorUwe Hermann <redacted>
Sat, 1 Feb 2014 23:40:23 +0000 (00:40 +0100)
committerUwe Hermann <redacted>
Sat, 1 Feb 2014 23:40:23 +0000 (00:40 +0100)
decoders/rtc8564/pd.py

index 3c8404af78e5513049ef7034e603a5338a9c224b..e919148af911fc1fde17ba2e6cfd3542f59c2d86 100644 (file)
@@ -66,6 +66,7 @@ class Decoder(srd.Decoder):
         self.minutes = -1
         self.seconds = -1
         self.days = -1
+        self.weekdays = -1
         self.months = -1
         self.years = -1
 
@@ -122,8 +123,9 @@ class Decoder(srd.Decoder):
         self.days = bcd2int(b & 0x3f)
         self.putx([5, ['Days: %d' % self.days]])
 
-    def handle_reg_0x06(self, b): # Day counter
-        pass
+    def handle_reg_0x06(self, b): # Weekdays
+        self.weekdays = bcd2int(b & 0x07)
+        self.putx([6, ['Weekdays: %d' % self.weekdays]])
 
     def handle_reg_0x07(self, b): # Months / century
         # TODO: Handle century bit.