Skip to content

Commit b1e8c43

Browse files
committed
Fix reload while display is updating.
1 parent 53fa65e commit b1e8c43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

shared-module/displayio/__init__.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <string.h>
33
#include "shared-module/displayio/__init__.h"
44

5+
#include "py/reload.h"
56
#include "shared-bindings/displayio/Bitmap.h"
67
#include "shared-bindings/displayio/Display.h"
78
#include "shared-bindings/displayio/Group.h"
@@ -22,6 +23,12 @@ static inline void swap(uint16_t* a, uint16_t* b) {
2223
bool refreshing_displays = false;
2324

2425
void displayio_refresh_displays(void) {
26+
// Somehow reloads from the sdcard are being lost. So, cheat and reraise.
27+
if (reload_requested) {
28+
mp_raise_reload_exception();
29+
return;
30+
}
31+
2532
if (refreshing_displays) {
2633
return;
2734
}

0 commit comments

Comments
 (0)