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 <i@779.moe> Change-Id: I3c508d1f20e8b71b732edd24cd6aa4e4bbdc0632
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <fstream>
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user