summaryrefslogtreecommitdiff
path: root/tests/extmod/framebuf1.py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-10-04 22:33:14 +1100
committerDamien George <damien@micropython.org>2023-10-16 12:18:08 +1100
commit03a9fa227d323da7b239a1ef3fa84b0ef45a1621 (patch)
treeeed9378d0c534e6c0dcf65c094cf0809ba2fe69f /tests/extmod/framebuf1.py
parentd040478d8aad7a05aac98651ec6ac5c2e9265a22 (diff)
extmod/modframebuf: Fix FrameBuffer get-buffer implementation.
This wasn't correctly accounting for the bits-per-pixel and was returning a bufinfo struct with the incorrect length. Instead, just forward directly to the underlying buffer object. Fixes issue #12563. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tests/extmod/framebuf1.py')
-rw-r--r--tests/extmod/framebuf1.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py
index d35674a70..b1173d536 100644
--- a/tests/extmod/framebuf1.py
+++ b/tests/extmod/framebuf1.py
@@ -109,3 +109,9 @@ except ValueError:
fbuf = framebuf.FrameBuffer1(buf, w, h)
fbuf = framebuf.FrameBuffer1(buf, w, h, w)
print(framebuf.MVLSB == framebuf.MONO_VLSB)
+
+# test get-buffer (returns the original buffer)
+fbuf = framebuf.FrameBuffer(bytearray(2), 8, 1, framebuf.MONO_HLSB)
+fbuf.pixel(0, 0, 1)
+fbuf.pixel(4, 0, 1)
+print(bytearray(fbuf))