From b04f9130c7eb1d41bf27556f58860bba63dd4bc5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 27 Mar 2021 12:04:23 -0500 Subject: [PATCH] RGBMatrix: fix memoryview(matrix) Typical test: ```python import displayio import rgbmatrix import board displayio.release_displays() matrix = rgbmatrix.RGBMatrix( width=128, bit_depth=4, rgb_pins=[board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5], addr_pins=[board.GP6, board.GP7, board.GP8, board.GP9], clock_pin=board.GP10, latch_pin=board.GP11, output_enable_pin=board.GP12) mem = memoryview(matrix) mem[0] = 65535 # OK mem[0] = 65536 # errors (out of range) ``` --- shared-bindings/rgbmatrix/RGBMatrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 045cc82b8f..0188fa0b60 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -441,6 +441,7 @@ STATIC mp_int_t rgbmatrix_rgbmatrix_get_buffer(mp_obj_t self_in, mp_buffer_info_ return 1; } *bufinfo = self->bufinfo; + bufinfo->typecode = 'H'; return 0; }