Skip to content

Commit 1af2b6a

Browse files
authored
Merge pull request #7563 from Neradoc/deinit-i2cdisplay-reset-on-raise
Deinit the reset pin when displayio.I2CDisplay fails
2 parents ec90d79 + 3c93594 commit 1af2b6a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

shared-module/displayio/I2CDisplay.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t *self,
5454
// Probe the bus to see if a device acknowledges the given address.
5555
if (!common_hal_busio_i2c_probe(i2c, device_address)) {
5656
self->base.type = &mp_type_NoneType;
57+
common_hal_displayio_i2cdisplay_deinit(self);
5758
mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address);
5859
}
5960

0 commit comments

Comments
 (0)