From ac090c7bdfcaab4c741c5100a18d93b336694305 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 10 May 2012 13:49:57 +0100 Subject: [PATCH] demo/python/mmap.py: Fix buffer wraparound bug. Fix bug reported by Ross Williamson where the code does not deal with buffer wraparound within a chunk of data. --- demo/python/mmap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo/python/mmap.py b/demo/python/mmap.py index 65f9f82..07652ba 100755 --- a/demo/python/mmap.py +++ b/demo/python/mmap.py @@ -185,6 +185,8 @@ while flag: map.seek(back%size) for i in range(back,front,2): DATA.fromstring(map.read(2)) + if map.tell() == size: + map.seek(0) DATA.tofile(of) # append data to log file ## time.sleep(.01) ret = c.comedi_mark_buffer_read(dev, subdevice, front-back) -- 2.26.2