displayio: Pause rgbmatrix during soft-reset

We can't handle rgbmatrix's interrupts from here until the display is
reinitialized, so set the display as paused.

With this change, I can survive multiple cycles with wifi+rgbmatrix
on an esp32s2.  Before, it usually failed.
This commit is contained in:
Jeff Epler 2021-05-26 11:01:04 -05:00
parent 4de8fa09ab
commit 0d7f257eae
1 changed files with 2 additions and 0 deletions

View File

@ -185,6 +185,8 @@ void reset_displays(void) {
rgbmatrix_rgbmatrix_obj_t *pm = &displays[i].rgbmatrix; rgbmatrix_rgbmatrix_obj_t *pm = &displays[i].rgbmatrix;
if (!any_display_uses_this_framebuffer(&pm->base)) { if (!any_display_uses_this_framebuffer(&pm->base)) {
common_hal_rgbmatrix_rgbmatrix_deinit(pm); common_hal_rgbmatrix_rgbmatrix_deinit(pm);
} else {
common_hal_rgbmatrix_rgbmatrix_set_paused(pm, true);
} }
#endif #endif
#if CIRCUITPY_SHARPDISPLAY #if CIRCUITPY_SHARPDISPLAY