Skip to content
Snippets Groups Projects

Display Backlight: automatically adjust to ambient sensor reading

Open cs requested to merge klausdieter1/firmware:autobacklight into master
4 unresolved threads
Files
2
@@ -8,18 +8,27 @@ void vAutoBrightnessTask(void *pvParameters)
{
vTaskDelay(pdMS_TO_TICKS(500));
while (epic_light_sensor_run() < 0)
LOG_CRIT("autobrightness", "Could not start ambient sensor");
while (1) {
vTaskDelay(pdMS_TO_TICKS(1000));
vTaskDelay(pdMS_TO_TICKS(60000));
if (_autobrightness_enabled) {
unsigned short int light;
if (epic_light_sensor_get(&light) < 0) {
LOG_CRIT("autobrightness", "Could not read light sensor");
continue;
while (epic_light_sensor_run() < 0)
LOG_CRIT(
"autobrightness",
"Could not start ambient sensor"
);
while (epic_light_sensor_get(&light) < 0) {
LOG_CRIT(
"autobrightness",
"Could not read light sensor"
);
vTaskDelay(pdMS_TO_TICKS(500));
}
epic_light_sensor_stop();
unsigned short int brightness;
if (light > 199)
Loading