diff options
| author | Radomir Dopieralski <openstack@sheep.art.pl> | 2021-02-21 13:43:28 +0100 |
|---|---|---|
| committer | Radomir Dopieralski <openstack@sheep.art.pl> | 2021-02-27 20:52:38 +0100 |
| commit | 121c6bcc9b20d7419f2654680215fd8b4bd455c4 (patch) | |
| tree | c508d7c503d774bbf40d60b89b788de9b2a3fd1d /supervisor/shared/display.c | |
| parent | 6e0ce23f3e2ce341bcaefdd0a0d5c98ff43949f0 (diff) | |
Replace displaio.Group.children with a python list
This is a first go at it, done by naive replacing of all array
operations with corresponding operations on the list. Note that
there is a lot of unnecessary type conversions, here. Also, list_pop
has been copied, because it's decalerd STATIC in py/objlist.h
Diffstat (limited to 'supervisor/shared/display.c')
| -rw-r--r-- | supervisor/shared/display.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a5830f764..1919cf4a4 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -270,15 +270,20 @@ displayio_tilegrid_t blinka_sprite = { }; #if CIRCUITPY_TERMINALIO -#define CHILD_COUNT 2 -displayio_group_child_t splash_children[2] = { - {&blinka_sprite}, - {&supervisor_terminal_text_grid}, +mp_obj_t members[] = { &blinka_sprite, &supervisor_terminal_text_grid, }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 2, + .len = 2, + .items = members, }; #else -#define CHILD_COUNT 1 -displayio_group_child_t splash_children[1] = { - {&blinka_sprite}, +mp_obj_t members[] = { &blinka_sprite }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 1, + .len = 1, + .items = members, }; #endif @@ -287,9 +292,7 @@ displayio_group_t circuitpython_splash = { .x = 0, .y = 0, .scale = 2, - .size = CHILD_COUNT, - .max_size = CHILD_COUNT, - .children = splash_children, + .members = &splash_children, .item_removed = false, .in_group = false, .hidden = false, |
