File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ void common_hal_displayio_display_refresh_soon(displayio_display_obj_t* self) {
147147
148148int32_t common_hal_displayio_display_wait_for_frame (displayio_display_obj_t * self ) {
149149 uint64_t last_refresh = self -> last_refresh ;
150- while (last_refresh == self -> last_refresh ) {
150+ // Don't try to refresh if we got an exception.
151+ while (last_refresh == self -> last_refresh && MP_STATE_VM (mp_pending_exception ) == NULL ) {
151152 MICROPY_VM_HOOK_LOOP
152153 }
153154 return 0 ;
Original file line number Diff line number Diff line change 22#include <string.h>
33#include "shared-module/displayio/__init__.h"
44
5+ #include "lib/utils/interrupt_char.h"
56#include "py/reload.h"
7+ #include "py/runtime.h"
68#include "shared-bindings/displayio/Bitmap.h"
79#include "shared-bindings/displayio/Display.h"
810#include "shared-bindings/displayio/Group.h"
@@ -23,8 +25,12 @@ static inline void swap(uint16_t* a, uint16_t* b) {
2325bool refreshing_displays = false;
2426
2527void displayio_refresh_displays (void ) {
28+ if (mp_hal_is_interrupted ()) {
29+ return ;
30+ }
2631 // Somehow reloads from the sdcard are being lost. So, cheat and reraise.
27- if (reload_requested ) {
32+ // But don't re-raise if already pending.
33+ if (reload_requested && MP_STATE_VM (mp_pending_exception ) == MP_OBJ_NULL ) {
2834 mp_raise_reload_exception ();
2935 return ;
3036 }
You can’t perform that action at this time.
0 commit comments