Deinit the reset pin when displayio.I2CDisplay raises an exception
This commit is contained in:
parent
7071478992
commit
3c93594563
|
@ -54,6 +54,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;
|
||||
common_hal_displayio_i2cdisplay_deinit(self);
|
||||
mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue