File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed 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) {
147
147
148
148
int32_t common_hal_displayio_display_wait_for_frame (displayio_display_obj_t * self ) {
149
149
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 ) {
151
152
MICROPY_VM_HOOK_LOOP
152
153
}
153
154
return 0 ;
Original file line number Diff line number Diff line change 2
2
#include <string.h>
3
3
#include "shared-module/displayio/__init__.h"
4
4
5
+ #include "lib/utils/interrupt_char.h"
5
6
#include "py/reload.h"
7
+ #include "py/runtime.h"
6
8
#include "shared-bindings/displayio/Bitmap.h"
7
9
#include "shared-bindings/displayio/Display.h"
8
10
#include "shared-bindings/displayio/Group.h"
@@ -23,8 +25,12 @@ static inline void swap(uint16_t* a, uint16_t* b) {
23
25
bool refreshing_displays = false;
24
26
25
27
void displayio_refresh_displays (void ) {
28
+ if (mp_hal_is_interrupted ()) {
29
+ return ;
30
+ }
26
31
// 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 ) {
28
34
mp_raise_reload_exception ();
29
35
return ;
30
36
}
You can’t perform that action at this time.
0 commit comments