File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 39
39
#include "shared-module/displayio/__init__.h"
40
40
#endif
41
41
42
+ #if CIRCUITPY_SHARPDISPLAY
43
+ #include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h"
44
+ #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h"
45
+ #endif
46
+
42
47
#if BOARD_I2C
43
48
// Statically allocate the I2C object so it can live past the end of the heap and into the next VM.
44
49
// That way it can be used by built-in I2CDisplay displays and be accessible through board.I2C().
@@ -148,10 +153,17 @@ void reset_board_busses(void) {
148
153
bool display_using_spi = false;
149
154
#if CIRCUITPY_DISPLAYIO
150
155
for (uint8_t i = 0 ; i < CIRCUITPY_DISPLAY_LIMIT ; i ++ ) {
151
- if (displays [i ].fourwire_bus .bus == spi_singleton ) {
156
+ mp_const_obj_t bus_type = displays [i ].bus_base .type ;
157
+ if (bus_type == & displayio_fourwire_type && displays [i ].fourwire_bus .bus == spi_singleton ) {
158
+ display_using_spi = true;
159
+ break ;
160
+ }
161
+ #if CIRCUITPY_SHARPDISPLAY
162
+ if (displays [i ].bus_base .type == & sharpdisplay_framebuffer_type && displays [i ].sharpdisplay .bus == spi_singleton ) {
152
163
display_using_spi = true;
153
164
break ;
154
165
}
166
+ #endif
155
167
}
156
168
#endif
157
169
if (!display_using_spi ) {
Original file line number Diff line number Diff line change 26
26
27
27
primary_display_t displays [CIRCUITPY_DISPLAY_LIMIT ];
28
28
29
- #if CIRCUITPY_RGBMATRIX || CIRCUITPY_SHARPDISPLAY
29
+ #if CIRCUITPY_RGBMATRIX
30
30
STATIC bool any_display_uses_this_framebuffer (mp_obj_base_t * obj ) {
31
31
for (uint8_t i = 0 ; i < CIRCUITPY_DISPLAY_LIMIT ; i ++ ) {
32
32
if (displays [i ].display_base .type == & framebufferio_framebufferdisplay_type ) {
@@ -186,11 +186,7 @@ void reset_displays(void) {
186
186
#if CIRCUITPY_SHARPDISPLAY
187
187
} else if (displays [i ].bus_base .type == & sharpdisplay_framebuffer_type ) {
188
188
sharpdisplay_framebuffer_obj_t * sharp = & displays [i ].sharpdisplay ;
189
- if (any_display_uses_this_framebuffer (& sharp -> base )) {
190
- common_hal_sharpdisplay_framebuffer_reset (sharp );
191
- } else {
192
- common_hal_sharpdisplay_framebuffer_deinit (sharp );
193
- }
189
+ common_hal_sharpdisplay_framebuffer_reset (sharp );
194
190
#endif
195
191
} else {
196
192
// Not an active display bus.
You can’t perform that action at this time.
0 commit comments