diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-01-31 11:00:12 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-01-31 11:42:15 -0800 |
| commit | 354a26963b9df6dcf281e49954483f147a6394a8 (patch) | |
| tree | aa128d2a74aabcf87afe0fae35c54e94f75e028e /shared-module | |
| parent | 2c069a5685c9e5bf6b1a081d5566357139c4dff3 (diff) | |
Correctly handle no backlight pin.
Diffstat (limited to 'shared-module')
| -rw-r--r-- | shared-module/displayio/Display.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |
