From: Uwe Hermann Date: Wed, 19 Feb 2014 17:58:09 +0000 (+0100) Subject: rtc8564: Use list comprehensions. X-Git-Tag: libsigrokdecode-0.3.0~82 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ae33d639670cd4ca6bfe683c4284dd55377e5f21;p=libsigrokdecode.git rtc8564: Use list comprehensions. --- diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index ce6ef75..8a2fbf9 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/pd.py @@ -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'],