From: Uwe Hermann Date: Wed, 4 Jul 2012 17:52:29 +0000 (+0200) Subject: srd: lm75: Warn about temperature reg. being read-only. X-Git-Tag: libsigrokdecode-0.1.1~58 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=86aac5f0a866f7a5bf5280ea44a291549554d661;p=libsigrokdecode.git srd: lm75: Warn about temperature reg. being read-only. --- diff --git a/decoders/lm75/lm75.py b/decoders/lm75/lm75.py index ef3191b..338086a 100644 --- a/decoders/lm75/lm75.py +++ b/decoders/lm75/lm75.py @@ -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