furble icon indicating copy to clipboard operation
furble copied to clipboard

Backlight timeout brightness is hardcoded and too high

Open gkoh opened this issue 6 months ago • 3 comments

Thanks to #108 I reviewed the backlight timeout brightness handling ... and it sucks with multiple problems.

Let's start with the first problem:

  • the hardcoded value (as seen in #108) is too high at 64

If we look at the ezBacklight::menu(), the brightness slider goes down to 48, something I recall determining via trial and error on the original M5StickC.

This means if we set minimum brightness at 48, we actually increase brightness to 64 during inactivity timeout, this is so wrong.

Second problem:

  • the minimum brightness is different for different devices
    • 64 is quite bright for the M5StickC Plus2 and M5Stack Core

I propose the following solutions:

  1. Add a private method to ezBacklight, say ezBacklight::getMinimumBrightness()
    • this should return the minimum viable brightness per device, I experimentally determined the following (subject to input):
      • M5StickC, M5StickC Plus == 48
      • M5StickC Plus2, M5Stack Core[2] == 16
  2. Use ezBacklight::getMinimumBrightness() in:
    • ezBacklight::loop() during inactivity
    • ezBacklight::menu() as the minimum brightness in the slider

gkoh avatar Aug 11 '24 04:08 gkoh