From: Uwe Hermann Date: Sat, 1 Feb 2014 23:40:23 +0000 (+0100) Subject: rtc8564: Handle register 0x06 (weekday). X-Git-Tag: libsigrokdecode-0.3.0~120 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3d1901418abc422d949dfd20c633af5c881620d7;p=libsigrokdecode.git rtc8564: Handle register 0x06 (weekday). --- diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index 3c8404a..e919148 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/pd.py @@ -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.