From d9312e6399d7bbb2ab5d15a5f5057cb2e25328f2 Mon Sep 17 00:00:00 2001 From: TH779 Date: Sun, 15 Aug 2021 01:54:07 +0800 Subject: [PATCH] raphael: light: Switch to green LED * In raphael, the LED named green is on the left side of the motor, and the LED named blue is on the right side of the motor. * Switch to the LED (green) on the left side of the motor to keep with the stock behavior to prevent its light leakage. * Thanks to @Ashu7397 for the idea. Signed-off-by: TH779 Change-Id: I3c508d1f20e8b71b732edd24cd6aa4e4bbdc0632 --- light/Light.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/light/Light.cpp b/light/Light.cpp index 9dc4704..1387da9 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -23,7 +23,7 @@ #include #define LCD_LED "/sys/class/backlight/panel0-backlight/" -#define BLUE_LED "/sys/class/leds/blue/" +#define GREEN_LED "/sys/class/leds/green/" #define BREATH "breath" #define BRIGHTNESS "brightness" @@ -89,13 +89,13 @@ static void handleBacklight(const LightState& state) { } static void handleNotification(const LightState& state) { - uint32_t blueBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); + uint32_t greenBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); /* Disable breathing or blinking */ - set(BLUE_LED BREATH, 0); - set(BLUE_LED BRIGHTNESS, 0); + set(GREEN_LED BREATH, 0); + set(GREEN_LED BRIGHTNESS, 0); - if (!blueBrightness) { + if (!greenBrightness) { return; } @@ -103,11 +103,11 @@ static void handleNotification(const LightState& state) { case Flash::HARDWARE: case Flash::TIMED: /* Breathing */ - set(BLUE_LED BREATH, 1); + set(GREEN_LED BREATH, 1); break; case Flash::NONE: default: - set(BLUE_LED BRIGHTNESS, blueBrightness); + set(GREEN_LED BRIGHTNESS, greenBrightness); } }