]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/rfm12/pd.py
Various PDs: Whitespace, cosmetics.
[libsigrokdecode.git] / decoders / rfm12 / pd.py
index c82a898f8e062c87eb9c27dd27de947dc3e63aca..30653838629495f8dc3cecf8c6cf5637b460489b 100644 (file)
@@ -1,7 +1,7 @@
 ##
 ## This file is part of the libsigrokdecode project.
 ##
-## Copyright (C) 2014 Sławek Piotrowski <slawomir.piotrowski@payu.pl>
+## Copyright (C) 2014 Sławek Piotrowski <sentinel@atteo.org>
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ class Decoder(srd.Decoder):
     id = 'rfm12'
     name = 'RFM12'
     longname = 'RFM12 control protocol'
-    desc = 'Protocol for controlling RFM12 wireless transceivers from HoperRF'
+    desc = 'HopeRF RFM12 wireless transceiver control protocol.'
     license = 'gplv2+'
     inputs = ['spi']
     outputs = ['rfm12']
@@ -120,7 +120,7 @@ class Decoder(srd.Decoder):
         self.describe_bits(bits, NAMES)
         self.describe_changed_bits(bits, old_bits, NAMES)
 
-        FREQUENCIES = ['Reserved', '433', '868', '912']
+        FREQUENCIES = ['315', '433', '868', '915']
         f = FREQUENCIES[(cmd[1] & 0x30) >> 4] + 'MHz'
         self.putx(1, 2, ['Frequency: ' + f, f])
         if cmd[1] & 0x30 != self.last_config & 0x30:
@@ -264,17 +264,17 @@ class Decoder(srd.Decoder):
         else:
             self.advance_ann(5, 2)
 
-        range = (cmd[1] & 0x30) >> 4
+        range_limit = (cmd[1] & 0x30) >> 4
         FREQ_TABLE = [0.0, 2.5, 5.0, 7.5]
         freq_delta = FREQ_TABLE[(self.last_config & 0x30) >> 4]
 
-        if range == 0:
+        if range_limit == 0:
             self.putx(0, 2, ['Range: No limit'])
-        elif range == 1:
+        elif range_limit == 1:
             self.putx(0, 2, ['Range: +/-%dkHz' % (15 * freq_delta)])
-        elif range == 2: 
+        elif range_limit == 2:
             self.putx(0, 2, ['Range: +/-%dkHz' % (7 * freq_delta)])
-        elif range == 3:
+        elif range_limit == 3:
             self.putx(0, 2, ['Range: +/-%dkHz' % (3 * freq_delta)])
 
         if (cmd[1] & 0x30) != (self.last_afc & 0x30):