diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2020-01-30 10:59:21 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2020-01-30 10:59:21 -0800 |
| commit | 55eb1730b89797c9b2b2115b3bec509acb490cb0 (patch) | |
| tree | 127714b653d8570fcb0c8e499eea266688e3c3b0 /shared-module | |
| parent | 2cc20e8816c6c1571b7488e83e3b13af79d50d65 (diff) | |
| parent | d22e95eedaccf24ffa91fda1dc101f6f05b1039f (diff) | |
Merge remote-tracking branch 'adafruit/master' into tweak_pixelbuf
Diffstat (limited to 'shared-module')
| -rw-r--r-- | shared-module/_stage/__init__.c | 6 | ||||
| -rw-r--r-- | shared-module/_stage/__init__.h | 3 | ||||
| -rw-r--r-- | shared-module/displayio/__init__.c | 8 |
3 files changed, 15 insertions, 2 deletions
diff --git a/shared-module/_stage/__init__.c b/shared-module/_stage/__init__.c index d5da74272..0323c32cb 100644 --- a/shared-module/_stage/__init__.c +++ b/shared-module/_stage/__init__.c @@ -34,7 +34,8 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, mp_obj_t *layers, size_t layers_size, uint16_t *buffer, size_t buffer_size, - displayio_display_obj_t *display, uint8_t scale) { + displayio_display_obj_t *display, + uint8_t scale, uint16_t background) { displayio_area_t area; @@ -68,6 +69,9 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, break; } } + if (c == TRANSPARENT) { + c = background; + } for (uint8_t xscale = 0; xscale < scale; ++xscale) { buffer[index] = c; index += 1; diff --git a/shared-module/_stage/__init__.h b/shared-module/_stage/__init__.h index 5af2124ae..7a1826200 100644 --- a/shared-module/_stage/__init__.h +++ b/shared-module/_stage/__init__.h @@ -37,6 +37,7 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, mp_obj_t *layers, size_t layers_size, uint16_t *buffer, size_t buffer_size, - displayio_display_obj_t *display, uint8_t scale); + displayio_display_obj_t *display, + uint8_t scale, uint16_t background); #endif // MICROPY_INCLUDED_SHARED_MODULE__STAGE diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index af22cb0df..efa61265e 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -16,6 +16,9 @@ #include "supervisor/shared/display.h" #include "supervisor/memory.h" +#include "supervisor/spi_flash_api.h" +#include "py/mpconfig.h" + primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; // Check for recursive calls to displayio_background. @@ -100,6 +103,11 @@ void reset_displays(void) { continue; } #endif + #ifdef BOARD_USE_INTERNAL_SPI + if (original_spi == (mp_obj_t)(&supervisor_flash_spi_bus)) { + continue; + } + #endif memcpy(&fourwire->inline_bus, original_spi, sizeof(busio_spi_obj_t)); fourwire->bus = &fourwire->inline_bus; // Check for other displays that use the same spi bus and swap them too. |
