Merge pull request #2330 from tannewt/epaper_gc_fix

Fix ePaper so it works after a GC.
This commit is contained in:
Dan Halbert 2019-11-26 16:37:02 -05:00 committed by GitHub
commit f7426e0e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include "shared-bindings/displayio/EPaperDisplay.h" #include "shared-bindings/displayio/EPaperDisplay.h"
#include "py/gc.h"
#include "py/runtime.h" #include "py/runtime.h"
#include "shared-bindings/displayio/ColorConverter.h" #include "shared-bindings/displayio/ColorConverter.h"
#include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/FourWire.h"
@ -298,7 +299,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
} }
bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self) { bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self) {
if (self->refreshing && self->busy.base.type == &digitalio_digitalinout_type) { if (self->refreshing && self->busy.base.type == &digitalio_digitalinout_type) {
if (common_hal_digitalio_digitalinout_get_value(&self->busy) != self->busy_state) { if (common_hal_digitalio_digitalinout_get_value(&self->busy) != self->busy_state) {
self->refreshing = false; self->refreshing = false;
@ -365,6 +366,8 @@ void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) {
void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t* self) { void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t* self) {
displayio_display_core_collect_ptrs(&self->core); displayio_display_core_collect_ptrs(&self->core);
gc_collect_ptr(self->start_sequence);
gc_collect_ptr(self->stop_sequence);
} }
bool maybe_refresh_epaperdisplay(void) { bool maybe_refresh_epaperdisplay(void) {