srd: lm75: Warn about temperature reg. being read-only.
authorUwe Hermann <uwe@hermann-uwe.de>
Wed, 4 Jul 2012 17:52:29 +0000 (19:52 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 5 Jul 2012 23:30:03 +0000 (01:30 +0200)
decoders/lm75/lm75.py

index ef3191b0d4a2636a2d00b275ab95cb94b256bcbd..338086a8b03913619db0ca84b1bc814f3aee6e9c 100644 (file)
@@ -109,6 +109,11 @@ class Decoder(srd.Decoder):
         self.putb([0, ['%s: %.1f °C' % (s, celsius)]])
         self.putb([1, ['%s: %.1f °K' % (s, kelvin)]])
 
+        # Warn about the temperature register (0x00) being read-only.
+        if s == 'Temperature' and rw == 'WRITE':
+            s = 'Warning: The temperature register is read-only!'
+            self.putb([4, [s]])
+
         # Keep some statistics. Can be output in report(), for example.
         if celsius < self.mintemp:
             self.mintemp = celsius