summaryrefslogtreecommitdiff
path: root/light/Light.cpp
diff options
context:
space:
mode:
authorDavide Garberi <dade.garberi@gmail.com>2020-01-08 00:03:06 +0100
committerMichael Bestas <mkbestas@lineageos.org>2020-04-30 00:48:54 +0300
commit2e418356c74de059bdeb29206b6e4832f5cfdb6a (patch)
tree0f90c584aaa471b544eb3956f5068e58648e81f4 /light/Light.cpp
parentfb4334f8231ec88cbf533485c58f286c252605de (diff)
sdm660-common: light: Rename red led to white
Change-Id: Ib88ada3ffb019a204762031b17d4d3c40d09f250
Diffstat (limited to 'light/Light.cpp')
-rw-r--r--light/Light.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/light/Light.cpp b/light/Light.cpp
index 780d3ab..7ab0d99 100644
--- a/light/Light.cpp
+++ b/light/Light.cpp
@@ -31,7 +31,7 @@ namespace implementation {
#define LEDS "/sys/class/leds/"
#define LCD_LED LEDS "lcd-backlight/"
#define BRIGHTNESS "brightness"
-#define RED LEDS "red/"
+#define WHITE LEDS "red/"
#define BLINK "blink"
#define DUTY_PCTS "duty_pcts"
#define PAUSE_HI "pause_hi"
@@ -93,24 +93,24 @@ static void handleXiaomiBacklight(Type /*type*/, const LightState& state) {
}
static void setNotification(const LightState& state) {
- uint32_t redBrightness, brightness;
+ uint32_t whiteBrightness, brightness;
/*
* Extract brightness from RGB.
*/
- redBrightness = (state.color >> 16) & 0xFF;
+ whiteBrightness = (state.color >> 16) & 0xFF;
brightness = (state.color >> 24) & 0xFF;
/*
* Scale RGB brightness if the Alpha brightness is not 0xFF.
*/
if (brightness != 0xFF) {
- redBrightness = (redBrightness * brightness) / 0xFF;
+ whiteBrightness = (whiteBrightness * brightness) / 0xFF;
}
/* Turn off the leds (initially) */
- set(RED BRIGHTNESS, 0);
- set(RED BLINK, 0);
+ set(WHITE BRIGHTNESS, 0);
+ set(WHITE BLINK, 0);
if (state.flashMode == Flash::TIMED) {
/*
@@ -126,15 +126,15 @@ static void setNotification(const LightState& state) {
pauseHi = 0;
}
- /* Red(Actually White) */
- set(RED BLINK, 1);
- set(RED START_IDX, 0 * RAMP_STEPS);
- set(RED DUTY_PCTS, getScaledRamp(redBrightness));
- set(RED PAUSE_LO, pauseLo);
- set(RED PAUSE_HI, pauseHi);
- set(RED RAMP_STEP_MS, stepDuration);
+ /* White */
+ set(WHITE BLINK, 1);
+ set(WHITE START_IDX, 0 * RAMP_STEPS);
+ set(WHITE DUTY_PCTS, getScaledRamp(whiteBrightness));
+ set(WHITE PAUSE_LO, pauseLo);
+ set(WHITE PAUSE_HI, pauseHi);
+ set(WHITE RAMP_STEP_MS, stepDuration);
} else {
- set(RED BRIGHTNESS, redBrightness);
+ set(WHITE BRIGHTNESS, whiteBrightness);
}
}