Skip to content

Commit b41d386

Browse files
committed
simplify arg checking for display
1 parent edc8383 commit b41d386

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

shared-bindings/displayio/Display.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
104104

105105
mp_obj_t display_bus = args[ARG_display_bus].u_obj;
106106

107-
mp_int_t width = args[ARG_width].u_int;
108-
mp_int_t height = args[ARG_height].u_int;
109-
if (width == -1 || height == -1) {
110-
mp_raise_ValueError(translate("Width and height kwargs required"));
111-
}
112107
mp_buffer_info_t bufinfo;
113108
mp_get_buffer_raise(args[ARG_init_sequence].u_obj, &bufinfo, MP_BUFFER_READ);
114109

@@ -125,7 +120,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
125120
}
126121
self->base.type = &displayio_display_type;
127122
common_hal_displayio_display_construct(self,
128-
display_bus, width, height, args[ARG_colstart].u_int, args[ARG_rowstart].u_int,
123+
display_bus, args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int,
129124
args[ARG_color_depth].u_int, args[ARG_set_column_command].u_int, args[ARG_set_row_command].u_int,
130125
args[ARG_write_ram_command].u_int, bufinfo.buf, bufinfo.len);
131126

0 commit comments

Comments
 (0)