summaryrefslogtreecommitdiff
path: root/shared-bindings/displayio
diff options
context:
space:
mode:
authorKevin Matocha <kmatocha@icloud.com>2020-09-01 13:57:19 -0500
committerKevin Matocha <kmatocha@icloud.com>2020-09-01 13:57:19 -0500
commite14de385283ad01b17e5abf51c5830db59a1a0f2 (patch)
tree0dff9cfbce8aff183c392b8c10c29a2dbf1c3428 /shared-bindings/displayio
parent8be862e644dad22641f5a4f9c1520f91df08d7a5 (diff)
Revise .refresh input default value for target_frames_per_second to None
Diffstat (limited to 'shared-bindings/displayio')
-rw-r--r--shared-bindings/displayio/Display.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c
index 9f3148dc7..b9e8d02b4 100644
--- a/shared-bindings/displayio/Display.c
+++ b/shared-bindings/displayio/Display.c
@@ -215,7 +215,7 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in)
}
MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show);
-//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> bool:
+//| def refresh(self, *, target_frames_per_second: int = None, minimum_frames_per_second: int = 1) -> bool:
//| """When auto refresh is off, waits for the target frame rate and then refreshes the display,
//| returning True. If the call has taken too long since the last refresh call for the given
//| target frame rate, then the refresh returns False immediately without updating the screen to
@@ -231,13 +231,14 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show
//| the display immediately.
//|
//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated.
+//| Set to None for immediate refresh.
//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second."""
//| ...
//|
STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second };
static const mp_arg_t allowed_args[] = {
- { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(60)} },
+ { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
{ MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
};
@@ -252,8 +253,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos
}
uint32_t target_ms_per_frame;
- if ( (args[ARG_target_frames_per_second].u_obj == mp_const_none) || (n_args == 1) ) {
- // if None or no arguments
+ if (args[ARG_target_frames_per_second].u_obj == mp_const_none) {
target_ms_per_frame = 0xffffffff;
}
else {