check for NULL in fill_area. moved start_terminal to reset_display.

This commit is contained in:
foamyguy 2022-11-27 13:54:53 -06:00
parent 2c479f4fce
commit 738b73d4b4
2 changed files with 12 additions and 32 deletions

View File

@ -136,30 +136,12 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self,
// Set the group after initialization otherwise we may send pixels while we delay in // Set the group after initialization otherwise we may send pixels while we delay in
// initialization. // initialization.
mp_printf(&mp_plat_print, "Inside display make_new\n");
is_null(&circuitpython_splash); common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
//is_null(0);
// if(circuitpython_splash == mp_const_none) {
// mp_printf(&mp_plat_print, "Splash is NULL \n");
// }
// 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_set_auto_refresh(self, auto_refresh); 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");
}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) { 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 inside display.show()\n");
}
return displayio_display_core_set_root_group(&self->core, root_group); return displayio_display_core_set_root_group(&self->core, root_group);
} }
@ -448,7 +430,10 @@ void release_display(displayio_display_obj_t *self) {
void reset_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_set_auto_refresh(self, true);
common_hal_displayio_display_show(self, &circuitpython_splash); circuitpython_splash.x = 0; // reset position in case someone moved it.
circuitpython_splash.y = 0;
supervisor_start_terminal(self->core.width, self->core.height);
common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
} }
void displayio_display_collect_ptrs(displayio_display_obj_t *self) { void displayio_display_collect_ptrs(displayio_display_obj_t *self) {

View File

@ -164,16 +164,8 @@ 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) { 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 if (root_group == NULL) {
//circuitpython_splash.in_group = false; // Show nothing on the display
// 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;
mp_printf(&mp_plat_print, "Inside set root group NULL\n");
//supervisor_start_terminal(self->width, self->height);
//root_group = &circuitpython_splash;
} }
if (root_group == self->current_group) { if (root_group == self->current_group) {
return true; return true;
@ -367,8 +359,11 @@ void displayio_display_core_collect_ptrs(displayio_display_core_t *self) {
} }
bool displayio_display_core_fill_area(displayio_display_core_t *self, displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { bool displayio_display_core_fill_area(displayio_display_core_t *self, displayio_area_t *area, uint32_t *mask, uint32_t *buffer) {
if(self->current_group != NULL){
return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer); return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer);
} }
return false;
}
bool displayio_display_core_clip_area(displayio_display_core_t *self, const displayio_area_t *area, displayio_area_t *clipped) { bool displayio_display_core_clip_area(displayio_display_core_t *self, const displayio_area_t *area, displayio_area_t *clipped) {
bool overlaps = displayio_area_compute_overlap(&self->area, area, clipped); bool overlaps = displayio_area_compute_overlap(&self->area, area, clipped);