summaryrefslogtreecommitdiff
path: root/decoders/rtc8564/pd.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-02-04 17:07:08 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2014-02-09 19:38:21 +0100
commitbff3a0a0031a32e19c1170e5a387197d879944ff (patch)
tree07e786b26b7c0e11a0d98bb560a63e8b0b445a65 /decoders/rtc8564/pd.py
parent09d09aceed72c7ca28023862c9049372dfef8d1d (diff)
downloadlibsigrokdecode-bff3a0a0031a32e19c1170e5a387197d879944ff.tar.gz
libsigrokdecode-bff3a0a0031a32e19c1170e5a387197d879944ff.zip
rtc8564: Improve short annotations.
Diffstat (limited to 'decoders/rtc8564/pd.py')
-rw-r--r--decoders/rtc8564/pd.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py
index 1961c66..ce6ef75 100644
--- a/decoders/rtc8564/pd.py
+++ b/decoders/rtc8564/pd.py
@@ -120,44 +120,45 @@ class Decoder(srd.Decoder):
def handle_reg_0x02(self, b): # Seconds / Voltage-low bit
vl = 1 if (b & (1 << 7)) else 0
self.putd(7, 7, [12, ['Voltage low: %d' % vl, 'Volt. low: %d' % vl,
- 'VL: %d' % vl]])
+ 'VL: %d' % vl, 'VL']])
s = self.seconds = bcd2int(b & 0x7f)
- self.putd(6, 0, [2, ['Second: %d' % s, 'Sec: %d' % s, 'S: %d' % s]])
+ self.putd(6, 0, [2, ['Second: %d' % s, 'Sec: %d' % s, 'S: %d' % s, 'S']])
def handle_reg_0x03(self, b): # Minutes
self.putr(7)
m = self.minutes = bcd2int(b & 0x7f)
- self.putd(6, 0, [3, ['Minute: %d' % m, 'Min: %d' % m, 'M: %d' % m]])
+ self.putd(6, 0, [3, ['Minute: %d' % m, 'Min: %d' % m, 'M: %d' % m, 'M']])
def handle_reg_0x04(self, b): # Hours
self.putr(7)
self.putr(6)
h = self.hours = bcd2int(b & 0x3f)
- self.putd(5, 0, [4, ['Hour: %d' % h, 'H: %d' % h]])
+ self.putd(5, 0, [4, ['Hour: %d' % h, 'H: %d' % h, 'H']])
def handle_reg_0x05(self, b): # Days
self.putr(7)
self.putr(6)
d = self.days = bcd2int(b & 0x3f)
- self.putd(5, 0, [5, ['Day: %d' % d, 'D: %d' % d]])
+ self.putd(5, 0, [5, ['Day: %d' % d, 'D: %d' % d, 'D']])
def handle_reg_0x06(self, b): # Weekdays
for i in (7, 6, 5, 4, 3):
self.putr(i)
w = self.weekdays = bcd2int(b & 0x07)
- self.putd(2, 0, [6, ['Weekday: %d' % w, 'WD: %d' % w]])
+ self.putd(2, 0, [6, ['Weekday: %d' % w, 'WD: %d' % w, 'WD', 'W']])
def handle_reg_0x07(self, b): # Months / century bit
c = 1 if (b & (1 << 7)) else 0
- self.putd(7, 7, [13, ['Century: %d' % c, 'Cent: %d' % c, 'C: %d' % c]])
+ self.putd(7, 7, [13, ['Century bit: %d' % c, 'Century: %d' % c,
+ 'Cent: %d' % c, 'C: %d' % c, 'C']])
self.putr(6)
self.putr(5)
m = self.months = bcd2int(b & 0x1f)
- self.putd(4, 0, [7, ['Month: %d' % m, 'Mon: %d' % m]])
+ self.putd(4, 0, [7, ['Month: %d' % m, 'Mon: %d' % m, 'M: %d' % m, 'M']])
def handle_reg_0x08(self, b): # Years
y = self.years = bcd2int(b & 0xff)
- self.putx([8, ['Year: %d' % y, 'Y: %d' % y]])
+ self.putx([8, ['Year: %d' % y, 'Y: %d' % y, 'Y']])
def handle_reg_0x09(self, b): # Alarm, minute
pass