Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 164fcfb8 authored by Jonas Larsson's avatar Jonas Larsson Committed by Madison Koenig
Browse files

Pimp automatic backlight.

Moving average filter for light sensor, support for custom levels, battery stats fix and dim fix.

Optimization: Don't compute the sum of all samples in filter window every run. Instead, keep track of the sum, subtract phased out sample, add new sample and divide new sum by number of valid samples. Massive CPU cycle savings.
Thanks to Jonathan (zenpoy on gmail dot com) for pointing me in the right direction!

Fix: The code for stopping the filter if the sensor has been stable the entire filter window time was only enabled if debug logging was enabled. Oops. CPU cycle savings in steady ambient light.

Tweak light sensor filter

1. Only allow decrease if user permitted it
2. Only perform filter reset on sensor increase and current average is below 1500 ("indoors")
3. Filter reset in 2. means pushing the filter half way towards new sample
4. Filter reset is disabled by default

This change requires commits from CMParts:

5f4026702b67b5d23c9a992f408e3861c90566db
f9238a01e4a4a64cb414dbdada36c97ae2a37db9
0a4b490035c333b3d77e6e59fcc0f7d16d78ebda
5036cc8217daf59aa9f2800bc3fa40e4dd4b3117
b43caaab217848668241681613ce8d54ceda69e9
cc0682a4cc43d0058db8b5195d4d329336f2d3fd

Change-Id: I9c88704484f4a23b3d643597f35b55d74cf36b56
parent 6abe6e0a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment