diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-10-01 11:04:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-01 11:04:21 -0700 |
| commit | c27e3857b6d2a1d162f8ea977ca1e99cbfb6417b (patch) | |
| tree | 57f53828546685100ec2c909af7ae45db1fb1e20 /shared-module/sharpdisplay/SharpMemoryFramebuffer.c | |
| parent | e477d27be36cf78ac4a7166aa18604b2f0bc910a (diff) | |
| parent | b9890f2d420665a96fcf56e196d36d0fc1032b66 (diff) | |
Merge branch 'main' into framebuffer-zero-size
Diffstat (limited to 'shared-module/sharpdisplay/SharpMemoryFramebuffer.c')
| -rw-r--r-- | shared-module/sharpdisplay/SharpMemoryFramebuffer.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index 71e00d7f0..c23446828 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -90,10 +90,6 @@ bool common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(sharpdispl } void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *self) { - if (!allocation_from_ptr(self->bufinfo.buf)) { - self->bufinfo.buf = NULL; - } - if (self->bus != &self->inline_bus #if BOARD_SPI && self->bus != common_hal_board_get_spi() @@ -105,7 +101,9 @@ void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *s } void common_hal_sharpdisplay_framebuffer_reconstruct(sharpdisplay_framebuffer_obj_t *self) { - + if (!allocation_from_ptr(self->bufinfo.buf)) { + self->bufinfo.buf = NULL; + } } void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_obj_t *self, mp_buffer_info_t *bufinfo) { |
