summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-01-26 14:35:26 -0600
committerJeff Epler <jepler@gmail.com>2021-01-26 14:35:26 -0600
commit20c9f25a654df33e4fb719edfeaad8c4d4396f5e (patch)
treedb3cae4027ea0cbb3a94b280ed39f80ba4b4f9c8 /shared-module
parent368977fb906e6561bd67977a47dc0b415547cc33 (diff)
rgbmatrix: Eliminate some duplicated height-calculating code
This was hard to write, so let's have it written in 2 places instead of 4.
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/rgbmatrix/RGBMatrix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c
index 4318604c6..b8db0d893 100644
--- a/shared-module/rgbmatrix/RGBMatrix.c
+++ b/shared-module/rgbmatrix/RGBMatrix.c
@@ -62,7 +62,7 @@ void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t *self, i
}
self->width = width;
- self->bufsize = 2 * width * rgb_count / 3 * (1 << addr_count) * tile;
+ self->bufsize = 2 * width * common_hal_rgbmatrix_rgbmatrix_get_height(self);
common_hal_rgbmatrix_rgbmatrix_reconstruct(self, framebuffer);
}