]> sigrok.org Git - libsigrokdecode.git/commitdiff
rtc8564: Use list comprehensions.
authorUwe Hermann <redacted>
Wed, 19 Feb 2014 17:58:09 +0000 (18:58 +0100)
committerUwe Hermann <redacted>
Sun, 23 Feb 2014 17:58:16 +0000 (18:58 +0100)
decoders/rtc8564/pd.py

index ce6ef7574ffe7c53401789dd79211e70e5442dcf..8a2fbf9592abb7a5597d8eb8f762a8e6096cb6af 100644 (file)
@@ -40,16 +40,8 @@ class Decoder(srd.Decoder):
         {'id': 'int', 'name': 'INT#', 'desc': 'Interrupt'},
     ]
     options = {}
-    annotations = [
-        ['reg-0x00', 'Register 0x00'],
-        ['reg-0x01', 'Register 0x01'],
-        ['reg-0x02', 'Register 0x02'],
-        ['reg-0x03', 'Register 0x03'],
-        ['reg-0x04', 'Register 0x04'],
-        ['reg-0x05', 'Register 0x05'],
-        ['reg-0x06', 'Register 0x06'],
-        ['reg-0x07', 'Register 0x07'],
-        ['reg-0x08', 'Register 0x08'],
+    annotations = \
+        [['reg-0x%02x' % i, 'Register 0x%02x' % i] for i in range(8 + 1)] + [
         ['read', 'Read date/time'],
         ['write', 'Write date/time'],
         ['bit-reserved', 'Reserved bit'],