summaryrefslogtreecommitdiff
path: root/shared-module/displayio/Display.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-02-28 22:36:50 -0500
committerDan Halbert <halbert@halwitz.org>2019-02-28 22:36:50 -0500
commitced37c10015464be575e8f1b0ae9a1838f34c45c (patch)
treeb6bfc65d371ff72b63707790f3688a3ea59d9d9e /shared-module/displayio/Display.c
parent2c9fbb5d40c457e87a4c0db3906960484f3668c0 (diff)
Don't wait for display frame if interrupt pending
Diffstat (limited to 'shared-module/displayio/Display.c')
-rw-r--r--shared-module/displayio/Display.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c
index da3424a36..1c9ba5702 100644
--- a/shared-module/displayio/Display.c
+++ b/shared-module/displayio/Display.c
@@ -147,7 +147,8 @@ void common_hal_displayio_display_refresh_soon(displayio_display_obj_t* self) {
int32_t common_hal_displayio_display_wait_for_frame(displayio_display_obj_t* self) {
uint64_t last_refresh = self->last_refresh;
- while (last_refresh == self->last_refresh) {
+ // Don't try to refresh if we got an exception.
+ while (last_refresh == self->last_refresh && MP_STATE_VM(mp_pending_exception) == NULL) {
MICROPY_VM_HOOK_LOOP
}
return 0;