summaryrefslogtreecommitdiff
path: root/shared-bindings/protomatter/Protomatter.c
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-bindings/protomatter/Protomatter.c
parent545b6e560a206fe2836647829e1707240d364c5f (diff)
protomatter: move get_width/height to common_hal
Diffstat (limited to 'shared-bindings/protomatter/Protomatter.c')
-rw-r--r--shared-bindings/protomatter/Protomatter.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/shared-bindings/protomatter/Protomatter.c b/shared-bindings/protomatter/Protomatter.c
index e3f735dde..4554c30bf 100644
--- a/shared-bindings/protomatter/Protomatter.c
+++ b/shared-bindings/protomatter/Protomatter.c
@@ -321,7 +321,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_refresh_obj, protomatter_proto
STATIC mp_obj_t protomatter_protomatter_get_width(mp_obj_t self_in) {
protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in;
check_for_deinit(self);
- return MP_OBJ_NEW_SMALL_INT(self->width);
+ return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_width(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_width_obj, protomatter_protomatter_get_width);
const mp_obj_property_t protomatter_protomatter_width_obj = {
@@ -338,8 +338,7 @@ const mp_obj_property_t protomatter_protomatter_width_obj = {
STATIC mp_obj_t protomatter_protomatter_get_height(mp_obj_t self_in) {
protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in;
check_for_deinit(self);
- int computed_get_height = (self->rgb_count / 3) << (self->addr_count);
- return MP_OBJ_NEW_SMALL_INT(computed_get_height);
+ return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_height(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_height_obj, protomatter_protomatter_get_height);