Fix reset pin null reference, construct error null reference

This commit is contained in:
Lucian Copeland 2020-09-10 15:37:43 -04:00
parent be199983c1
commit f95ad7b27c
2 changed files with 7 additions and 2 deletions

View File

@ -76,7 +76,9 @@ void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self) {
common_hal_reset_pin(self->command.pin);
common_hal_reset_pin(self->chip_select.pin);
if (self->reset.pin) {
common_hal_reset_pin(self->reset.pin);
}
}
bool common_hal_displayio_fourwire_reset(mp_obj_t obj) {

View File

@ -53,6 +53,7 @@ void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t* self,
// Probe the bus to see if a device acknowledges the given address.
if (!common_hal_busio_i2c_probe(i2c, device_address)) {
self->base.type = &mp_type_NoneType;
mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address);
}
@ -71,7 +72,9 @@ void common_hal_displayio_i2cdisplay_deinit(displayio_i2cdisplay_obj_t* self) {
common_hal_busio_i2c_deinit(self->bus);
}
if (self->reset.pin) {
common_hal_reset_pin(self->reset.pin);
}
}
bool common_hal_displayio_i2cdisplay_reset(mp_obj_t obj) {