summaryrefslogtreecommitdiff
path: root/shared-bindings/framebufferio
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-04-15 12:29:32 -0500
committerJeff Epler <jepler@gmail.com>2020-04-17 18:43:57 -0500
commit57ce2d1f417bd4c2988155d45739a3a61950471f (patch)
tree9f75b80a93b38affb58fdcd2098282d51131253d /shared-bindings/framebufferio
parent3d6258f63dce84519704251b86a16c832958c8a6 (diff)
framebufferio: get width, etc., from protocol, not object property
Diffstat (limited to 'shared-bindings/framebufferio')
-rw-r--r--shared-bindings/framebufferio/FramebufferDisplay.c17
-rw-r--r--shared-bindings/framebufferio/FramebufferDisplay.h7
2 files changed, 4 insertions, 20 deletions
diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c
index 5014f3924..820eda51a 100644
--- a/shared-bindings/framebufferio/FramebufferDisplay.c
+++ b/shared-bindings/framebufferio/FramebufferDisplay.c
@@ -39,10 +39,6 @@
#include "shared-module/displayio/__init__.h"
#include "supervisor/shared/translate.h"
-STATIC int get_int_property(mp_obj_t obj, qstr attr) {
- return mp_obj_get_int(mp_load_attr(obj, attr));
-}
-
//| .. currentmodule:: framebufferio
//|
//| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM
@@ -79,25 +75,14 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t
mp_raise_ValueError(translate("Display rotation must be in 90 degree increments"));
}
- int width = get_int_property(framebuffer, MP_QSTR_width);
- int height = get_int_property(framebuffer, MP_QSTR_height);
- int color_depth = get_int_property(framebuffer, MP_QSTR_color_depth);
- int bytes_per_cell = get_int_property(framebuffer, MP_QSTR_bytes_per_cell);
- int native_frames_per_second = get_int_property(framebuffer, MP_QSTR_native_frames_per_second);
-
primary_display_t *disp = allocate_display_or_raise();
framebufferio_framebufferdisplay_obj_t *self = &disp->framebuffer_display;
self->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
self,
framebuffer,
- width,
- height,
rotation,
- color_depth,
- bytes_per_cell,
- args[ARG_auto_refresh].u_bool,
- native_frames_per_second
+ args[ARG_auto_refresh].u_bool
);
return self;
diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h
index b472088d2..e7ead6ac5 100644
--- a/shared-bindings/framebufferio/FramebufferDisplay.h
+++ b/shared-bindings/framebufferio/FramebufferDisplay.h
@@ -39,10 +39,9 @@ extern const mp_obj_type_t framebufferio_framebufferdisplay_type;
#define NO_BRIGHTNESS_COMMAND 0x100
void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self,
- mp_obj_t framebuffer, uint16_t width, uint16_t height,
- uint16_t rotation, uint16_t color_depth,
- uint8_t bytes_per_cell,
- bool auto_refresh, uint16_t native_frames_per_second);
+ mp_obj_t framebuffer,
+ uint16_t rotation,
+ bool auto_refresh);
bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self,
displayio_group_t* root_group);