diff options
| author | Dave Astels <dastels@daveastels.com> | 2019-08-20 13:48:12 -0400 |
|---|---|---|
| committer | Dave Astels <dastels@daveastels.com> | 2019-08-20 13:48:12 -0400 |
| commit | eb0a8cc0bf5ccb93a4ad89e2cf965a45986fec2e (patch) | |
| tree | 4e30928f3a87d3c1a3fcd4d05112787b172b67f1 /shared-bindings/displayio | |
| parent | 0fd886fa7f923c6c8a1473712d238084d9004432 (diff) | |
Move the get_buffer call earlier
Diffstat (limited to 'shared-bindings/displayio')
| -rw-r--r-- | shared-bindings/displayio/Display.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b7b9a6981..099035f41 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -402,6 +402,9 @@ STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *po mp_raise_ValueError(translate("Display must have a 16 bit colorspace.")); } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(result, &bufinfo, MP_BUFFER_WRITE); + displayio_area_t area = { .x1 = 0, .y1 = y, @@ -415,8 +418,6 @@ STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *po buffer_size += 1; } - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(result, &bufinfo, MP_BUFFER_WRITE); uint32_t *result_buffer = bufinfo.buf; size_t result_buffer_size = bufinfo.len; |
