working on None behavior

This commit is contained in:
foamyguy 2022-11-26 11:00:09 -06:00
parent fa4b480439
commit 2c479f4fce
2 changed files with 12 additions and 9 deletions

View File

@ -144,19 +144,21 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self,
// }
// mp_printf(&mp_plat_print, *circuitpython_splash);
// mp_printf(&mp_plat_print, "\n");
common_hal_displayio_display_show(self, &circuitpython_splash);
//common_hal_displayio_display_show(self, &circuitpython_splash);
common_hal_displayio_display_set_auto_refresh(self, auto_refresh);
}
void is_null(displayio_group_t *root_group){
if (root_group == NULL){
mp_printf(&mp_plat_print, "root_group is null\n");
mp_printf(&mp_plat_print, "root_group is NULL\n");
}else{
mp_printf(&mp_plat_print, "root_group not NULL");
}
}
bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) {
if(root_group == NULL){
mp_printf(&mp_plat_print, "Its NULL fer flucks snakes\n");
mp_printf(&mp_plat_print, "Its NULL inside display.show()\n");
}
return displayio_display_core_set_root_group(&self->core, root_group);
}
@ -446,7 +448,7 @@ void release_display(displayio_display_obj_t *self) {
void reset_display(displayio_display_obj_t *self) {
common_hal_displayio_display_set_auto_refresh(self, true);
common_hal_displayio_display_show(self, NULL);
common_hal_displayio_display_show(self, &circuitpython_splash);
}
void displayio_display_collect_ptrs(displayio_display_obj_t *self) {

View File

@ -165,14 +165,15 @@ void displayio_display_core_set_rotation(displayio_display_core_t *self,
bool displayio_display_core_set_root_group(displayio_display_core_t *self, displayio_group_t *root_group) {
if (root_group == NULL) { // set the display to the REPL, reset REPL position and size
circuitpython_splash.in_group = false;
//circuitpython_splash.in_group = false;
// force the circuit_python_splash out of any group (Note: could cause problems with the parent group)
circuitpython_splash.x = 0; // reset position in case someone moved it.
circuitpython_splash.y = 0;
//circuitpython_splash.x = 0; // reset position in case someone moved it.
//circuitpython_splash.y = 0;
mp_printf(&mp_plat_print, "Inside set root group NULL\n");
supervisor_start_terminal(self->width, self->height);
//supervisor_start_terminal(self->width, self->height);
//root_group = &circuitpython_splash;
root_group = &circuitpython_splash;
}
if (root_group == self->current_group) {
return true;