diff --git a/firmware/src/boards/waveshare_amoled_216/display.cpp b/firmware/src/boards/waveshare_amoled_216/display.cpp index 14b8561..a1cf7b7 100644 --- a/firmware/src/boards/waveshare_amoled_216/display.cpp +++ b/firmware/src/boards/waveshare_amoled_216/display.cpp @@ -1,5 +1,6 @@ #include "../../hal/display_hal.h" #include "../../hal/imu_hal.h" +#include "../../brightness.h" #include "board.h" #include #include @@ -119,8 +120,11 @@ void display_hal_tick(void) { if (now - ramp_last < 25) return; ramp_last = now; - static const uint8_t levels[] = {60, 120, 170, 200}; - display_hal_set_brightness(levels[ramp_step - 1]); + // Ramp back to the user's chosen brightness (not a hardcoded level), so a + // physical rotation doesn't reset what they set via PWR-short-press. + static const uint8_t pct[] = {30, 60, 85, 100}; + uint8_t target = brightness_get(); + display_hal_set_brightness((uint8_t)(((uint16_t)target * pct[ramp_step - 1]) / 100)); if (ramp_step >= 4) ramp_step = 0; else ramp_step++; }