diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-03-26 18:16:11 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-03-26 18:16:11 -0400 |
| commit | 348df4be2ba1bfc00a7bfab4f0de35beea78a407 (patch) | |
| tree | e2c588b3abe40afc7b971f0ca7059a01bd2dac9c /shared-module/displayio/Display.c | |
| parent | c4db8b87e2c57ca94b8f76e4b07ca02641df714e (diff) | |
| parent | aec3b2419b2c52f6f42249207cfe2b6de5d58f61 (diff) | |
Merge remote-tracking branch 'upstream/master' into stm32x7-setup
Diffstat (limited to 'shared-module/displayio/Display.c')
| -rw-r--r-- | shared-module/displayio/Display.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 299c8ad35..820fbcce6 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -50,7 +50,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second) { + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high) { // Turn off auto-refresh as we init. self->auto_refresh = false; uint16_t ram_width = 0x100; @@ -159,6 +159,9 @@ mp_float_t common_hal_displayio_display_get_brightness(displayio_display_obj_t* bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, mp_float_t brightness) { self->updating_backlight = true; + if (!self->backlight_on_high){ + brightness = 1.0-brightness; + } bool ok = false; if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); |
