added error when not selecting hwe or hre

This commit is contained in:
2025-01-26 20:36:12 +01:00
parent c986defd61
commit e73fd72b09

View File

@@ -136,6 +136,9 @@ class Decoder(srd.Decoder):
have_hre = self.has_channel(21) have_hre = self.has_channel(21)
hre_active_low = self.options['hre_polarity'] == 'low' hre_active_low = self.options['hre_polarity'] == 'low'
if not have_hwe and not have_hre:
raise ChannelError('Either hre or hwe must be set!')
cs_active_low = self.options['cs_polarity'] == 'low' cs_active_low = self.options['cs_polarity'] == 'low'
cmd_active_low = self.options['cmd_polarity'] == 'low' cmd_active_low = self.options['cmd_polarity'] == 'low'
rst_active_low = self.options['rst_polarity'] == 'low' rst_active_low = self.options['rst_polarity'] == 'low'