Skip to content

Commit 75ee47b

Browse files
committed
adafruit_fruit_jam: expose the DVI display as board.DISPLAY
The auto-constructed picodvi/HSTX display lands in displays[0] (via picodvi_autoconstruct) but was only reachable through supervisor.runtime.display, so code reading board.DISPLAY.width/height (the size-independent convention) hit AttributeError. Map board.DISPLAY to displays[0].framebuffer_display, matching adafruit_feather_rp2040_dvi. Lets games run unchanged on the Fruit Jam.
1 parent 9fecc30 commit 75ee47b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • ports/raspberrypi/boards/adafruit_fruit_jam

‎ports/raspberrypi/boards/adafruit_fruit_jam/pins.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "py/objtuple.h"
88
#include "shared-bindings/board/__init__.h"
9+
#include "shared-module/displayio/__init__.h"
910

1011
// Four consecutive data GPIOs for the 4-bit SDIO interface (sdioio.SDCard).
1112
static const mp_rom_obj_tuple_t sdio_data_tuple = {
@@ -22,6 +23,10 @@ static const mp_rom_obj_tuple_t sdio_data_tuple = {
2223
static const mp_rom_map_elem_t board_module_globals_table[] = {
2324
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
2425

26+
// Expose the auto-constructed DVI/HSTX display as board.DISPLAY (like adafruit_feather_rp2040_dvi),
27+
// so code that reads board.DISPLAY.width/height works instead of only supervisor.runtime.display.
28+
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].framebuffer_display) },
29+
2530

2631
// On JST PH connector.
2732
{ MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO40) },

0 commit comments

Comments
 (0)