Deinit the reset pin when displayio.I2CDisplay raises an exception

This commit is contained in:
Neradoc 2023-02-10 19:54:10 +01:00
parent 7071478992
commit 3c93594563
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}