diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2020-04-11 00:41:11 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2020-04-11 15:09:15 +0200 |
commit | d1b0d3a3407dc774de860ff92ba904117bc1e48a (patch) | |
tree | 910a3cf6973153c52057c37927cd61c30bf2531d | |
parent | c10beafec69030be810314e61d6695cf13bad3ad (diff) | |
download | libsigrokdecode-d1b0d3a3407dc774de860ff92ba904117bc1e48a.tar.gz libsigrokdecode-d1b0d3a3407dc774de860ff92ba904117bc1e48a.zip |
ad5626: Always use the same number of decimal places.
-rw-r--r-- | decoders/ad5626/pd.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/decoders/ad5626/pd.py b/decoders/ad5626/pd.py index 453ee20..cffee83 100644 --- a/decoders/ad5626/pd.py +++ b/decoders/ad5626/pd.py @@ -43,9 +43,6 @@ class Decoder(srd.Decoder): def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) - def put_data(self, pos, data): - self.put(pos[0], pos[1], self.out_ann, [0, [str(data) + 'V']]) - def decode(self, ss, es, data): ptype = data[0] @@ -54,7 +51,7 @@ class Decoder(srd.Decoder): if cs_old is not None and cs_old == 0 and cs_new == 1: self.data >>= 1 self.data /= 1000 - self.put_data([self.ss, es], self.data) + self.put(self.ss, es, self.out_ann, [0, ['%.3fV' % self.data]]) self.data = 0 elif cs_old is not None and cs_old == 1 and cs_new == 0: self.ss = ss |