summaryrefslogtreecommitdiff
path: root/decoders/rtc8564
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/rtc8564')
-rw-r--r--decoders/rtc8564/pd.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py
index 9e5fedd..ed55d4c 100644
--- a/decoders/rtc8564/pd.py
+++ b/decoders/rtc8564/pd.py
@@ -105,7 +105,7 @@ class Decoder(srd.Decoder):
self.putx([1, [ann]])
- def handle_reg_0x02(self, b): # Seconds / Voltage-low flag
+ def handle_reg_0x02(self, b): # Seconds / Voltage-low bit
s = self.seconds = bcd2int(b & 0x7f)
self.putx([2, ['Second: %d' % s, 'Sec: %d' % s, 'S: %d' % s]])
vl = 1 if (b & (1 << 7)) else 0
@@ -128,10 +128,11 @@ class Decoder(srd.Decoder):
w = self.weekdays = bcd2int(b & 0x07)
self.putx([6, ['Weekday: %d' % w, 'WD: %d' % w]])
- def handle_reg_0x07(self, b): # Months / century
- # TODO: Handle century bit.
+ def handle_reg_0x07(self, b): # Months / century bit
m = self.months = bcd2int(b & 0x1f)
self.putx([7, ['Month: %d' % m, 'Mon: %d' % m]])
+ c = 1 if (b & (1 << 7)) else 0
+ self.putx([11, ['Century: %d' % c, 'Cent: %d' % c, 'C: %d' % c]])
def handle_reg_0x08(self, b): # Years
y = self.years = bcd2int(b & 0xff)