X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fam230x%2Fpd.py;h=5375ab2bf5b1fb299518a69cf0c7856d38fcf870;hb=dcfb60a1658243c3130774fe00645e7fedb23211;hp=9a783b9cb4849ac0eeb73c50b433804e51306dee;hpb=f87162978a3f804d43ae12208c3d6a4a86382c1c;p=libsigrokdecode.git diff --git a/decoders/am230x/pd.py b/decoders/am230x/pd.py index 9a783b9..5375ab2 100644 --- a/decoders/am230x/pd.py +++ b/decoders/am230x/pd.py @@ -24,8 +24,8 @@ import sigrokdecode as srd timing = { 'START LOW' : {'min': 750, 'max': 25000}, 'START HIGH' : {'min': 10, 'max': 10000}, - 'RESPONSE LOW' : {'min': 70, 'max': 90}, - 'RESPONSE HIGH' : {'min': 70, 'max': 90}, + 'RESPONSE LOW' : {'min': 50, 'max': 90}, + 'RESPONSE HIGH' : {'min': 50, 'max': 90}, 'BIT LOW' : {'min': 45, 'max': 90}, 'BIT 0 HIGH' : {'min': 20, 'max': 35}, 'BIT 1 HIGH' : {'min': 65, 'max': 80}, @@ -47,8 +47,8 @@ class Decoder(srd.Decoder): {'id': 'sda', 'name': 'SDA', 'desc': 'Single wire serial data line'}, ) options = ( - {'id': 'dht11', 'desc': 'DHT11 compatibility mode', - 'default': 'no', 'values': ('no', 'yes')}, + {'id': 'device', 'desc': 'Device type', + 'default': 'am230x', 'values': ('am230x', 'dht11')}, ) annotations = ( ('start', 'Start'), @@ -101,7 +101,7 @@ class Decoder(srd.Decoder): def calculate_humidity(self, bitlist): h = 0 - if self.options['dht11'] == 'yes': + if self.options['device'] == 'dht11': h = self.bits2num(bitlist[0:8]) else: h = self.bits2num(bitlist) / 10 @@ -109,7 +109,7 @@ class Decoder(srd.Decoder): def calculate_temperature(self, bitlist): t = 0 - if self.options['dht11'] == 'yes': + if self.options['device'] == 'dht11': t = self.bits2num(bitlist[0:8]) else: t = self.bits2num(bitlist[1:]) / 10