Skip to content

Commit 36a23e0

Browse files
committed
Rework refresh API and factor common display stuff out
NOT TESTED! Just compiles Fixes micropython#1691
1 parent c247e7d commit 36a23e0

File tree

24 files changed

+726
-730
lines changed

24 files changed

+726
-730
lines changed

ports/atmel-samd/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
289289
$(addprefix common-hal/, $(SRC_COMMON_HAL))
290290

291291
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
292-
$(addprefix shared-module/, $(SRC_SHARED_MODULE))
292+
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
293+
$(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))
293294

294295
SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s
295296

ports/atmel-samd/boards/hallowing_m0_express/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ void board_init(void) {
106106
1.0f, // brightness (ignored)
107107
true, // auto_brightness
108108
false, // single_byte_bounds
109-
false); // data_as_commands
109+
false, // data_as_commands
110+
true, // auto_refresh
111+
60); // native_frames_per_second
110112
}
111113

112114
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pybadge/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ void board_init(void) {
108108
1.0f, // brightness (ignored)
109109
true, // auto_brightness
110110
false, // single_byte_bounds
111-
false); // data_as_commands
111+
false, // data_as_commands
112+
true, // auto_refresh
113+
60); // native_frames_per_second
112114
}
113115

114116
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pybadge_airlift/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ void board_init(void) {
8686
1.0f, // brightness (ignored)
8787
true, // auto_brightness
8888
false, // single_byte_bounds
89-
false); // data_as_commands
89+
false, // data_as_commands
90+
true, // auto_refresh
91+
60); // native_frames_per_second
9092
}
9193

9294
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pygamer/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ void board_init(void) {
108108
1.0f, // brightness (ignored)
109109
true, // auto_brightness
110110
false, // single_byte_bounds
111-
false); // data_as_commands
111+
false, // data_as_commands
112+
true, // auto_refresh
113+
60); // native_frames_per_second
112114
}
113115

114116
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pygamer_advance/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ void board_init(void) {
8686
1.0f, // brightness (ignored)
8787
true, // auto_brightness
8888
false, // single_byte_bounds
89-
false); // data_as_commands
89+
false, // data_as_commands
90+
true, // auto_refresh
91+
60); // native_frames_per_second
9092
}
9193

9294
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pyportal/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ void board_init(void) {
9898
1.0f, // brightness (ignored)
9999
true, // auto_brightness
100100
false, // single_byte_bounds
101-
false); // data_as_commands
101+
false, // data_as_commands
102+
true, // auto_refresh
103+
60); // native_frames_per_second
102104
}
103105

104106
bool board_requests_safe_mode(void) {

ports/atmel-samd/boards/pyportal_titano/board.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ void board_init(void) {
118118
1.0f, // brightness (ignored)
119119
true, // auto_brightness
120120
false, // single_byte_bounds
121-
false); // data_as_commands
121+
false, // data_as_commands
122+
true, // auto_refresh
123+
60); // native_frames_per_second
122124
}
123125

124126
bool board_requests_safe_mode(void) {

ports/nrf/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
192192
$(addprefix common-hal/, $(SRC_COMMON_HAL))
193193

194194
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
195-
$(addprefix shared-module/, $(SRC_SHARED_MODULE))
195+
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
196+
$(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))
196197

197198
SRC_S = supervisor/cpu.s
198199

ports/stm32f4/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
216216
$(addprefix common-hal/, $(SRC_COMMON_HAL))
217217

218218
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
219-
$(addprefix shared-module/, $(SRC_SHARED_MODULE))
219+
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
220+
$(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))
220221

221222

222223

py/circuitpy_defns.mk

+6
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ SRC_SHARED_MODULE_ALL += \
364364
touchio/__init__.c
365365
endif
366366

367+
# All possible sources are listed here, and are filtered by SRC_PATTERNS.
368+
SRC_SHARED_MODULE_INTERNAL = \
369+
$(filter $(SRC_PATTERNS), \
370+
displayio/display_core.c \
371+
)
372+
367373
ifeq ($(INTERNAL_LIBM),1)
368374
SRC_LIBM = \
369375
$(addprefix lib/,\

shared-bindings/_stage/__init__.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "shared-bindings/busio/SPI.h"
3131
#include "shared-bindings/displayio/Display.h"
3232
#include "shared-module/_stage/__init__.h"
33+
#include "shared-module/displayio/display_core.h"
3334
#include "Layer.h"
3435
#include "Text.h"
3536

@@ -95,20 +96,21 @@ STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) {
9596
scale = mp_obj_get_int(args[7]);
9697
}
9798

98-
while (!displayio_display_begin_transaction(display)) {
99+
// TODO: Everything below should be in shared-module because it's not argument parsing.
100+
while (!displayio_display_core_begin_transaction(&display->core)) {
99101
RUN_BACKGROUND_TASKS;
100102
}
101103
displayio_area_t area;
102104
area.x1 = x0;
103105
area.y1 = y0;
104106
area.x2 = x1;
105107
area.y2 = y1;
106-
displayio_display_set_region_to_update(display, &area);
108+
displayio_display_core_set_region_to_update(&display->core, display->set_column_command, display->set_row_command, NO_COMMAND, NO_COMMAND, display->data_as_commands, false, &area);
107109

108-
display->send(display->bus, true, &display->write_ram_command, 1);
110+
display->core.send(display->core.bus, true, true, &display->write_ram_command, 1);
109111
render_stage(x0, y0, x1, y1, layers, layers_size, buffer, buffer_size,
110112
display, scale);
111-
displayio_display_end_transaction(display);
113+
displayio_display_core_end_transaction(&display->core);
112114

113115
return mp_const_none;
114116
}

shared-bindings/displayio/Display.c

+35-19
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
//| Most people should not use this class directly. Use a specific display driver instead that will
5252
//| contain the initialization sequence at minimum.
5353
//|
54-
//| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, grayscale=False, pixels_in_byte_share_row=True, bytes_per_cell=1, reverse_pixels_in_byte=False, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, brightness_command=None, brightness=1.0, auto_brightness=False, single_byte_bounds=False, data_as_commands=False)
54+
//| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, grayscale=False, pixels_in_byte_share_row=True, bytes_per_cell=1, reverse_pixels_in_byte=False, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, brightness_command=None, brightness=1.0, auto_brightness=False, single_byte_bounds=False, data_as_commands=False, auto_refresh=True, native_frames_per_second=60)
5555
//|
5656
//| Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
5757
//|
@@ -102,9 +102,11 @@
102102
//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism.
103103
//| :param bool single_byte_bounds: Display column and row commands use single bytes
104104
//| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this.
105+
//| :param bool auto_refresh: Automatically refresh the screen
106+
//| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence.
105107
//|
106108
STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
107-
enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands };
109+
enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second };
108110
static const mp_arg_t allowed_args[] = {
109111
{ MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ },
110112
{ MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ },
@@ -128,6 +130,8 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
128130
{ MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
129131
{ MP_QSTR_single_byte_bounds, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
130132
{ MP_QSTR_data_as_commands, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
133+
{ MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} },
134+
{ MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} },
131135
};
132136
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
133137
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
@@ -178,7 +182,9 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
178182
brightness,
179183
args[ARG_auto_brightness].u_bool,
180184
args[ARG_single_byte_bounds].u_bool,
181-
args[ARG_data_as_commands].u_bool
185+
args[ARG_data_as_commands].u_bool,
186+
args[ARG_auto_refresh].u_bool,
187+
args[ARG_native_frames_per_second].u_int
182188
);
183189

184190
return self;
@@ -214,14 +220,28 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show
214220

215221
//| .. method:: refresh(*, target_frames_per_second=None, minimum_frames_per_second=1)
216222
//|
217-
//| Waits for the target frame rate and then refreshes the display. If the call is too late for the given target frame rate, then the refresh returns immediately without updating the screen to hopefully help getting caught up. If the current frame rate is below the minimum frame rate, then an exception will be raised.
223+
//| When auto refresh is off, waits for the target frame rate and then refreshes the display. If
224+
//| the call is too late for the given target frame rate, then the refresh returns immediately
225+
//| without updating the screen to hopefully help getting caught up. If the current frame rate
226+
//| is below the minimum frame rate, then an exception will be raised.
218227
//|
219-
STATIC mp_obj_t displayio_display_obj_refresh(mp_obj_t self_in) {
220-
displayio_display_obj_t *self = native_display(self_in);
221-
common_hal_displayio_display_refresh(self);
228+
//| When auto refresh is on, updates the display immediately. (The display will also update
229+
//| without calls to this.)
230+
//|
231+
STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
232+
enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second };
233+
static const mp_arg_t allowed_args[] = {
234+
{ MP_QSTR_target_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 60} },
235+
{ MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
236+
};
237+
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
238+
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
239+
240+
displayio_display_obj_t *self = native_display(pos_args[0]);
241+
common_hal_displayio_display_refresh(self, 1000 / args[ARG_target_frames_per_second].u_int, 1000 / args[ARG_minimum_frames_per_second].u_int);
222242
return mp_const_none;
223243
}
224-
MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_refresh_soon_obj, displayio_display_obj_refresh_soon);
244+
MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh);
225245

226246
//| .. attribute:: auto_refresh
227247
//|
@@ -376,7 +396,7 @@ const mp_obj_property_t displayio_display_rotation_obj = {
376396
//|
377397
STATIC mp_obj_t displayio_display_obj_get_bus(mp_obj_t self_in) {
378398
displayio_display_obj_t *self = native_display(self_in);
379-
return self->bus;
399+
return common_hal_displayio_display_get_bus(self);
380400
}
381401
MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_bus_obj, displayio_display_obj_get_bus);
382402

@@ -412,18 +432,18 @@ STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *po
412432
if (bufinfo.typecode != BYTEARRAY_TYPECODE) {
413433
mp_raise_ValueError(translate("Buffer is not a bytearray."));
414434
}
415-
if (self->colorspace.depth != 16) {
435+
if (self->core.colorspace.depth != 16) {
416436
mp_raise_ValueError(translate("Display must have a 16 bit colorspace."));
417437
}
418438

419439
displayio_area_t area = {
420440
.x1 = 0,
421441
.y1 = y,
422-
.x2 = self->width,
442+
.x2 = self->core.width,
423443
.y2 = y + 1
424444
};
425-
uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->colorspace.depth;
426-
uint16_t buffer_size = self->width / pixels_per_word;
445+
uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth;
446+
uint16_t buffer_size = self->core.width / pixels_per_word;
427447
uint16_t pixels_per_buffer = displayio_area_size(&area);
428448
if (pixels_per_buffer % pixels_per_word) {
429449
buffer_size += 1;
@@ -440,21 +460,17 @@ STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *po
440460
mask[k] = 0x00000000;
441461
}
442462

443-
displayio_display_fill_area(self, &area, mask, result_buffer);
463+
displayio_display_core_fill_area(&self->core, &area, mask, result_buffer);
444464
return result;
445465
} else {
446466
mp_raise_ValueError(translate("Buffer is too small"));
447467
}
448468
}
449469
MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_fill_row_obj, 1, displayio_display_obj_fill_row);
450470

451-
452-
453-
454471
STATIC const mp_rom_map_elem_t displayio_display_locals_dict_table[] = {
455472
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_display_show_obj) },
456-
{ MP_ROM_QSTR(MP_QSTR_refresh_soon), MP_ROM_PTR(&displayio_display_refresh_soon_obj) },
457-
{ MP_ROM_QSTR(MP_QSTR_wait_for_frame), MP_ROM_PTR(&displayio_display_wait_for_frame_obj) },
473+
{ MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&displayio_display_refresh_obj) },
458474
{ MP_ROM_QSTR(MP_QSTR_fill_row), MP_ROM_PTR(&displayio_display_fill_row_obj) },
459475

460476
{ MP_ROM_QSTR(MP_QSTR_auto_refresh), MP_ROM_PTR(&displayio_display_auto_refresh_obj) },

shared-bindings/displayio/Display.h

+14-9
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,29 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
4444
bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte,
4545
uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll,
4646
uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command,
47-
mp_float_t brightness, bool auto_brightness, bool auto_refresh, uint8_t frames_per_second,
48-
bool single_byte_bounds, bool data_as_commands);
47+
mp_float_t brightness, bool auto_brightness,
48+
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second);
4949

50-
bool common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group);
50+
bool common_hal_displayio_display_show(displayio_display_obj_t* self,
51+
displayio_group_t* root_group);
5152

52-
void common_hal_displayio_display_refresh(displayio_display_obj_t* self);
53+
// Times in ms.
54+
void common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_t target_frame_time, uint32_t maximum_frame_time);
5355

54-
bool displayio_display_begin_transaction(displayio_display_obj_t* self);
55-
void displayio_display_end_transaction(displayio_display_obj_t* self);
56-
57-
bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t* self);
58-
void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t* self, bool auto_brightness);
56+
bool common_hal_displayio_display_get_auto_refresh(displayio_display_obj_t* self);
57+
void common_hal_displayio_display_set_auto_refresh(displayio_display_obj_t* self, bool auto_refresh);
5958

6059
uint16_t common_hal_displayio_display_get_width(displayio_display_obj_t* self);
6160
uint16_t common_hal_displayio_display_get_height(displayio_display_obj_t* self);
6261
uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t* self);
6362

63+
bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t* self);
64+
void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t* self, bool auto_brightness);
65+
6466
mp_float_t common_hal_displayio_display_get_brightness(displayio_display_obj_t* self);
6567
bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, mp_float_t brightness);
6668

69+
mp_obj_t common_hal_displayio_display_get_bus(displayio_display_obj_t* self);
70+
71+
6772
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_DISPLAY_H

shared-bindings/displayio/EPaperDisplay.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisp
208208
//| Refreshes the display immediately or raises an exception if too soon. Use
209209
//| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.
210210
//|
211-
STATIC mp_obj_t displayio_epaperdisplay_obj_refresh_soon(mp_obj_t self_in) {
211+
STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) {
212212
displayio_epaperdisplay_obj_t *self = native_display(self_in);
213213
bool ok = common_hal_displayio_epaperdisplay_refresh(self);
214214
if (!ok) {
215215
mp_raise_RuntimeError(translate("Refresh too soon"));
216216
}
217217
return mp_const_none;
218218
}
219-
MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_soon_obj, displayio_epaperdisplay_obj_refresh_soon);
219+
MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_obj, displayio_epaperdisplay_obj_refresh);
220220

221221
//| .. attribute:: time_to_refresh
222222
//|
@@ -225,7 +225,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_soon_obj, displayio_ep
225225
//|
226226
STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) {
227227
displayio_epaperdisplay_obj_t *self = native_display(self_in);
228-
return mp_obj_new_float(common_hal_displayio_epaperdisplay_get_time_to_refresh(self));
228+
return mp_obj_new_float(common_hal_displayio_epaperdisplay_get_time_to_refresh(self) / 1000.0);
229229
}
230230
MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_time_to_refresh_obj, displayio_epaperdisplay_obj_get_time_to_refresh);
231231

@@ -279,7 +279,7 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = {
279279
//|
280280
STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) {
281281
displayio_epaperdisplay_obj_t *self = native_display(self_in);
282-
return self->bus;
282+
return common_hal_displayio_epaperdisplay_get_bus(self);
283283
}
284284
MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_bus_obj, displayio_epaperdisplay_obj_get_bus);
285285

@@ -293,7 +293,7 @@ const mp_obj_property_t displayio_epaperdisplay_bus_obj = {
293293

294294
STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = {
295295
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_epaperdisplay_show_obj) },
296-
{ MP_ROM_QSTR(MP_QSTR_refresh_soon), MP_ROM_PTR(&displayio_epaperdisplay_refresh_obj) },
296+
{ MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&displayio_epaperdisplay_refresh_obj) },
297297

298298
{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_epaperdisplay_width_obj) },
299299
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_epaperdisplay_height_obj) },

0 commit comments

Comments
 (0)