Skip to content

Commit e2f0fc6

Browse files
committed
Update ST7789 SPI driver to use ndarray.ndim
See v923z/micropython-ulab#725
1 parent 4354a73 commit e2f0fc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/display/st7789_spi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def _get_common_roi_with_buffer(self, image):
264264

265265
# Determing number of rows and columns in the image
266266
image_rows = image.shape[0]
267-
if len(image.shape) < 2:
267+
if image.ndim < 2:
268268
image_cols = 1
269269
else:
270270
image_cols = image.shape[1]
@@ -314,7 +314,7 @@ def _write_image_to_buffer_bgr565(self, image_roi, buffer_roi):
314314
buffer_roi (ndarray): Buffer region of interest
315315
"""
316316
# Determine the number of channels in the image
317-
if len(image_roi.shape) < 3:
317+
if image_roi.ndim < 3:
318318
ch = 1
319319
else:
320320
ch = image_roi.shape[2]

0 commit comments

Comments
 (0)