From 354a26963b9df6dcf281e49954483f147a6394a8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 31 Jan 2019 11:00:12 -0800 Subject: Correctly handle no backlight pin. --- shared-module/displayio/Display.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shared-module/displayio/Display.c') diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index ac1d0e933..ef0334d10 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -100,6 +100,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->refresh = true; self->current_group = &circuitpython_splash; + // Always set the backlight type in case we're reusing memory. + self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 5000, false); if (result != PWMOUT_OK) { -- cgit v1.2.3