diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-19 15:07:39 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-19 15:07:39 +0100 |
commit | 8967e839a3df6aa8766f57e521c81edd3a12be4d (patch) | |
tree | 8d2a335aa6ad27182131c37cfc72595a56926ed9 /decoders/rgb_led/pd.py | |
parent | 2c1732728b130a71105cd9deaf36c9213ef44a82 (diff) | |
download | libsigrokdecode-8967e839a3df6aa8766f57e521c81edd3a12be4d.tar.gz libsigrokdecode-8967e839a3df6aa8766f57e521c81edd3a12be4d.zip |
rgb_led: Minor cosmetics, whitespace.
Diffstat (limited to 'decoders/rgb_led/pd.py')
-rw-r--r-- | decoders/rgb_led/pd.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/decoders/rgb_led/pd.py b/decoders/rgb_led/pd.py index 38bd64d..f3a6388 100644 --- a/decoders/rgb_led/pd.py +++ b/decoders/rgb_led/pd.py @@ -21,11 +21,11 @@ import sigrokdecode as srd class Decoder(srd.Decoder): - api_version =1 + api_version = 1 id = 'rgb_led' name = 'RGB LED (SPI mode)' longname = 'RGB LED string decoder (SPI mode)' - desc = '' + desc = 'Generic RGB LED string protocol (RGB values clocked over SPI).' license = 'gplv2' inputs = ['spi'] outputs = ['rgb_led'] @@ -33,8 +33,7 @@ class Decoder(srd.Decoder): optional_probes = [] options = {} annotations = [ - ['text', 'Human-readable text'], - ['warnings', 'Human-readable warnings'], + ['rgb', 'RGB values'], ] def __init__(self, **kwargs): @@ -50,7 +49,7 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): ptype, mosi, miso = data - # Only care about data packets + # Only care about data packets. if ptype != 'DATA': return self.ss, self.es = ss, es @@ -63,7 +62,7 @@ class Decoder(srd.Decoder): if len(self.mosi_bytes) != 3: return - red, green, blue = self.mosi_bytes + red, green, blue = self.mosi_bytes rgb_value = int(red) << 16 rgb_value |= int(green) << 8 rgb_value |= int(blue) |