From c9e98bbf349dd74dfe3d6ef1a71f91418dfc2eb4 Mon Sep 17 00:00:00 2001
From: Nao Pross <np@0hm.ch>
Date: Wed, 24 Nov 2021 20:20:40 +0100
Subject: Discussion

---
 src/gr-fadingui/python/qa_xor_frame_sync.py | 2 +-
 src/gr-fadingui/python/xor_frame_sync.py    | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/gr-fadingui')

diff --git a/src/gr-fadingui/python/qa_xor_frame_sync.py b/src/gr-fadingui/python/qa_xor_frame_sync.py
index e763d00..9c480a0 100644
--- a/src/gr-fadingui/python/qa_xor_frame_sync.py
+++ b/src/gr-fadingui/python/qa_xor_frame_sync.py
@@ -19,7 +19,7 @@ class test_xor_frame_sync(gr_unittest.TestCase):
         pattern = np.array([0xc0, 0xff, 0xee], dtype=np.uint8)
         testdata = np.packbits(np.concatenate([
             np.unpackbits(np.arange(0, 5, dtype=np.uint8)),
-            # np.random.randint(0, 2, size = 8 * 5),
+            np.random.randint(0, 2, size = 8 * 5),
             np.unpackbits(pattern),
             np.random.randint(0, 2, size = 64)
         ]))
diff --git a/src/gr-fadingui/python/xor_frame_sync.py b/src/gr-fadingui/python/xor_frame_sync.py
index 312ad2a..bb5cfb1 100644
--- a/src/gr-fadingui/python/xor_frame_sync.py
+++ b/src/gr-fadingui/python/xor_frame_sync.py
@@ -133,16 +133,20 @@ class xor_frame_sync(gr.sync_block):
         # return data with delay
         out = output_items[0]
         # FIXME: this is also wrong
-        out[:] = self.delaybuf[:len(out)]
+        # out[:] = self.delaybuf[:len(out)]
+        out[:] = inp[:]
 
 
         inptmp = np.array(inp[:12], dtype=np.uint8)
         inphex = np.array(list(map(hex, inptmp)))
+        inpbits = np.array(list(map("{:08b}".format, inptmp)))
+
         log.debug(f"inp={inptmp}")
         log.debug(f"inp={inphex}")
+        log.debug(f"inp={inpbits}")
 
         # outtmp = np.array(out[:12], dtype=np.uint8)
         # log.debug(f"out={outtmp}")
 
-        return len(out)
+        return inp_len
 
-- 
cgit v1.2.1