summaryrefslogtreecommitdiff
path: root/shared-module/protomatter
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-04-15 10:19:33 -0500
committerJeff Epler <jepler@gmail.com>2020-04-17 18:43:57 -0500
commit64c3968a2e2c626036fcd3d148eae7ba092e6096 (patch)
treea85acce646d2fbd5f80858a2ec79ee036f7a0cf2 /shared-module/protomatter
parent545b6e560a206fe2836647829e1707240d364c5f (diff)
protomatter: move get_width/height to common_hal
Diffstat (limited to 'shared-module/protomatter')
-rw-r--r--shared-module/protomatter/Protomatter.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shared-module/protomatter/Protomatter.c b/shared-module/protomatter/Protomatter.c
index 37721cb1c..e7fa4ba9a 100644
--- a/shared-module/protomatter/Protomatter.c
+++ b/shared-module/protomatter/Protomatter.c
@@ -198,3 +198,12 @@ void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* s
_PM_swapbuffer_maybe(&self->core);
}
+int common_hal_protomatter_protomatter_get_width(protomatter_protomatter_obj_t* self) {
+ return self->width;
+}
+
+int common_hal_protomatter_protomatter_get_height(protomatter_protomatter_obj_t* self) {
+ int computed_height = (self->rgb_count / 3) << (self->addr_count);
+ return computed_height;
+}
+