diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-21 22:39:55 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-06-22 12:10:52 +0200 |
commit | 288e22b0cfe75e52e68c5ca2e586b47e26ccf91a (patch) | |
tree | ceb71171d13942a3036d0ce5884f8a6a3455fc36 /decoders | |
parent | 068960b63ae6eca1392561fde5efac09e846251c (diff) | |
download | libsigrokdecode-288e22b0cfe75e52e68c5ca2e586b47e26ccf91a.tar.gz libsigrokdecode-288e22b0cfe75e52e68c5ca2e586b47e26ccf91a.zip |
jtag_ejtag: Simplify some code snippets.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/jtag_ejtag/pd.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/decoders/jtag_ejtag/pd.py b/decoders/jtag_ejtag/pd.py index 80888ed..ba5db2a 100644 --- a/decoders/jtag_ejtag/pd.py +++ b/decoders/jtag_ejtag/pd.py @@ -243,24 +243,23 @@ class Decoder(srd.Decoder): ss, es = self.pracc_state.ss, self.pracc_state.es pracc_write = (control_out & ControlReg.PRNW) != 0 - display_string = 'PrAcc: ' - display_string += 'Store' if pracc_write else 'Load/Fetch' + s = 'PrAcc: ' + s += 'Store' if pracc_write else 'Load/Fetch' if pracc_write: if self.pracc_state.address_out != None: - display_string += ', A:' + ' 0x{:08X}'.format(self.pracc_state.address_out) + s += ', A:' + ' 0x{:08X}'.format(self.pracc_state.address_out) if self.pracc_state.data_out != None: - display_string += ', D:' + ' 0x{:08X}'.format(self.pracc_state.data_out) + s += ', D:' + ' 0x{:08X}'.format(self.pracc_state.data_out) else: if self.pracc_state.address_out != None: - display_string += ', A:' + ' 0x{:08X}'.format(self.pracc_state.address_out) + s += ', A:' + ' 0x{:08X}'.format(self.pracc_state.address_out) if self.pracc_state.data_in != None: - display_string += ', D:' + ' 0x{:08X}'.format(self.pracc_state.data_in) + s += ', D:' + ' 0x{:08X}'.format(self.pracc_state.data_in) self.pracc_state.reset() - display_data = [Ann.PRACC, [display_string]] - self.put_at(ss, es, display_data) + self.put_at(ss, es, [Ann.PRACC, [s]]) def parse_control_reg(self, ann): reg_write = ann == Ann.CONTROL_FIELD_IN @@ -292,9 +291,8 @@ class Decoder(srd.Decoder): short_desc = comment + ': ' + value_str long_desc = value_descriptions[value_index] if len(value_descriptions) > value_index else '?' - display_data = [ann, [long_desc, short_desc]] - self.put_at(ss, es, display_data) + self.put_at(ss, es, [ann, [long_desc, short_desc]]) def check_last_data(self): if not hasattr(self, 'last_data'): |