@@ -55,7 +55,9 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self,
5555 common_hal_digitalio_digitalinout_construct (& self -> chip_select , chip_select );
5656 common_hal_digitalio_digitalinout_switch_to_output (& self -> chip_select , true, DRIVE_MODE_PUSH_PULL );
5757
58+ self -> reset .base .type = & mp_type_NoneType ;
5859 if (reset != NULL ) {
60+ self -> reset .base .type = & digitalio_digitalinout_type ;
5961 common_hal_digitalio_digitalinout_construct (& self -> reset , reset );
6062 common_hal_digitalio_digitalinout_switch_to_output (& self -> reset , true, DRIVE_MODE_PUSH_PULL );
6163 never_reset_pin_number (reset -> number );
@@ -76,12 +78,16 @@ void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self) {
7678 reset_pin_number (self -> reset .pin -> number );
7779}
7880
79- void common_hal_displayio_fourwire_reset (mp_obj_t obj ) {
81+ bool common_hal_displayio_fourwire_reset (mp_obj_t obj ) {
8082 displayio_fourwire_obj_t * self = MP_OBJ_TO_PTR (obj );
83+ if (self -> reset .base .type == & mp_type_NoneType ) {
84+ return false;
85+ }
8186 common_hal_digitalio_digitalinout_set_value (& self -> reset , false);
8287 common_hal_time_delay_ms (1 );
8388 common_hal_digitalio_digitalinout_set_value (& self -> reset , true);
8489 common_hal_time_delay_ms (1 );
90+ return true;
8591}
8692
8793bool common_hal_displayio_fourwire_bus_free (mp_obj_t obj ) {
0 commit comments