display: set lower limit for brightness

Fixes #158
custom
Clayton Craft 4 months ago committed by cooljqln
parent d985cfb5fb
commit 8a6c41be45
  1. 4
      src/drivers/display.cpp

@ -194,6 +194,10 @@ auto Display::SetDisplayOn(bool enabled) -> void {
}
auto Display::SetBrightness(uint_fast8_t percent) -> void {
// Set a lower limit of 7%, below this the backlight turns off.
// See https://codeberg.org/cool-tech-zone/tangara-fw/issues/158
if (percent < 7)
percent = 7;
brightness_ =
std::pow(static_cast<double>(percent) / 100.0, 2.8) * 1024.0 + 0.5;
if (first_flush_finished_ && display_on_) {

Loading…
Cancel
Save