diff options
| author | Jeff Epler <jepler@unpythonic.net> | 2021-03-27 12:04:23 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@unpythonic.net> | 2021-03-27 12:04:27 -0500 |
| commit | b04f9130c7eb1d41bf27556f58860bba63dd4bc5 (patch) | |
| tree | eb08f3d90d99e8bcf328dbe640b01d9577553de4 /shared-bindings | |
| parent | 155b61f0275efc1eac805ed37070834e81bb32ba (diff) | |
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)
```
Diffstat (limited to 'shared-bindings')
| -rw-r--r-- | shared-bindings/rgbmatrix/RGBMatrix.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 045cc82b8..0188fa0b6 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; } |
