Skip to content

Commit f7426e0

Browse files
authored
Merge pull request #2330 from tannewt/epaper_gc_fix
Fix ePaper so it works after a GC.
2 parents e560b41 + d32dc81 commit f7426e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shared-module/displayio/EPaperDisplay.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "shared-bindings/displayio/EPaperDisplay.h"
2828

29+
#include "py/gc.h"
2930
#include "py/runtime.h"
3031
#include "shared-bindings/displayio/ColorConverter.h"
3132
#include "shared-bindings/displayio/FourWire.h"
@@ -298,7 +299,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
298299
}
299300

300301
bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self) {
301-
302+
302303
if (self->refreshing && self->busy.base.type == &digitalio_digitalinout_type) {
303304
if (common_hal_digitalio_digitalinout_get_value(&self->busy) != self->busy_state) {
304305
self->refreshing = false;
@@ -365,6 +366,8 @@ void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) {
365366

366367
void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t* self) {
367368
displayio_display_core_collect_ptrs(&self->core);
369+
gc_collect_ptr(self->start_sequence);
370+
gc_collect_ptr(self->stop_sequence);
368371
}
369372

370373
bool maybe_refresh_epaperdisplay(void) {

0 commit comments

Comments
 (0)