diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2020-01-01 20:22:03 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2020-01-10 20:50:15 +0100 |
commit | 6d6b23f908cb908fa6495bcd4a7bcc787177fd2f (patch) | |
tree | 8d67872149918edb4ca865450f7ffdd09fb15eb2 /decoders | |
parent | 29cc1e22ee337a79f5205137410f866238395430 (diff) | |
download | libsigrokdecode-6d6b23f908cb908fa6495bcd4a7bcc787177fd2f.tar.gz libsigrokdecode-6d6b23f908cb908fa6495bcd4a7bcc787177fd2f.zip |
mcs48: Use SrdIntEnum for annotation classes.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/mcs48/pd.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/decoders/mcs48/pd.py b/decoders/mcs48/pd.py index 99b2efc..8c52de9 100644 --- a/decoders/mcs48/pd.py +++ b/decoders/mcs48/pd.py @@ -18,6 +18,10 @@ ## import sigrokdecode as srd +from common.srdhelper import SrdIntEnum + +Ann = SrdIntEnum.from_str('Ann', 'ROMDATA') +Bin = SrdIntEnum.from_str('Bin', 'ROMDATA') class ChannelError(Exception): pass @@ -95,10 +99,10 @@ class Decoder(srd.Decoder): self.data_s = self.samplenum if self.started: anntext = '{:04X}:{:02X}'.format(self.addr, self.data) - self.put(self.addr_s, self.data_s, self.out_ann, [0, [anntext]]) + self.put(self.addr_s, self.data_s, self.out_ann, [Ann.ROMDATA, [anntext]]) bindata = self.addr.to_bytes(2, byteorder='big') bindata += self.data.to_bytes(1, byteorder='big') - self.put(self.addr_s, self.data_s, self.out_bin, [0, bindata]) + self.put(self.addr_s, self.data_s, self.out_bin, [Bin.ROMDATA, bindata]) def decode(self): # Address bits above A11 are optional, and are considered to be A12+. |