summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-06-14 02:02:42 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2012-06-14 02:02:42 +0200
commitc1c1d34feecda97ab42fb7c3b9f7cb8a6fed190e (patch)
treeada8e6c1cdf783ce4fd4c2d87a55866b13b9a9b3
parenta0153e903ba04cf9e6eb8c8a501508f4606efa6b (diff)
downloadlibsigrokdecode-c1c1d34feecda97ab42fb7c3b9f7cb8a6fed190e.tar.gz
libsigrokdecode-c1c1d34feecda97ab42fb7c3b9f7cb8a6fed190e.zip
srd: uart_dump: Fix file output (flush).
We need to flush the file output buffer(s), lacking a stop() call in PDs at the moment, which could do the flush (or file close()) only once at the end of the PD "session".
-rw-r--r--decoders/uart_dump/uart_dump.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/decoders/uart_dump/uart_dump.py b/decoders/uart_dump/uart_dump.py
index 6ed0b61..8f190bc 100644
--- a/decoders/uart_dump/uart_dump.py
+++ b/decoders/uart_dump/uart_dump.py
@@ -95,16 +95,20 @@ class Decoder(srd.Decoder):
if self.f != None:
if self.options['rx'] == 'yes' and rxtx == RX:
self.f.write(c)
+ self.f.flush()
if self.options['tx'] == 'yes' and rxtx == TX:
self.f.write(c)
+ self.f.flush()
# Output RX data to 'filename_rx'.
if self.f_rx != None:
if self.options['rx'] == 'yes' and rxtx == RX:
self.f_rx.write(c)
+ self.f_rx.flush()
# Output TX data to 'filename_tx'.
if self.f_tx != None:
if self.options['tx'] == 'yes' and rxtx == TX:
self.f_tx.write(c)
+ self.f_tx.flush()