summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/display.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/display.cpp b/src/drivers/display.cpp
index 7321f20b..15cd6c62 100644
--- a/src/drivers/display.cpp
+++ b/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_) {