summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-11-23 23:06:45 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2014-11-23 23:06:45 +0100
commit70aa53ec10dabe4a5267e142974b35d1312f7119 (patch)
tree43500d65e729845953423cf0e55bb340b979dca0
parent05aaa48637fe56ac087569d784dbfdc91341f619 (diff)
downloadlibsigrokdecode-70aa53ec10dabe4a5267e142974b35d1312f7119.tar.gz
libsigrokdecode-70aa53ec10dabe4a5267e142974b35d1312f7119.zip
jitter: Simplify ascii-float binary out.
This also outputs one item of OUT_BINARY per jitter value (not one item per ASCII character in the ASCII floating point number).
-rw-r--r--decoders/jitter/pd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoders/jitter/pd.py b/decoders/jitter/pd.py
index f2fdb62..d6db8e5 100644
--- a/decoders/jitter/pd.py
+++ b/decoders/jitter/pd.py
@@ -109,10 +109,10 @@ class Decoder(srd.Decoder):
def putb(self, delta):
if delta is None:
return
- # Format the delta to an ASCII float output.
- for x in str(delta):
- self.put(self.clk_start, self.sig_start, self.out_bin, (0, bytes([ord(x)])))
- self.put(self.clk_start, self.sig_start, self.out_bin, (0, bytes([ord('\n')])))
+ # Format the delta to an ASCII float value terminated by a newline.
+ x = str(delta) + '\n'
+ self.put(self.clk_start, self.sig_start, self.out_bin,
+ (0, x.encode('UTF-8')))
# Helper function for missed clock and signal annotations.
def putm(self, data):