]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/uart_dump/uart_dump.py
README: Add status, update URL, small fixes.
[libsigrokdecode.git] / decoders / uart_dump / uart_dump.py
index 6ed0b6110ddb5625a8970f14e700d7b14d6ca2ba..11748326658d9dcde7f8fe39e285baa336aae9dd 100644 (file)
@@ -93,18 +93,18 @@ class Decoder(srd.Decoder):
 
         # Output RX and/or TX to 'filename'.
         if self.f != None:
-            if self.options['rx'] == 'yes' and rxtx == RX:
-                self.f.write(c)
-            if self.options['tx'] == 'yes' and rxtx == TX:
-                self.f.write(c)
+            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()