summaryrefslogtreecommitdiff
path: root/board/elm
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 13:33:10 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-29 00:30:18 +0000
commita2bd40ce35728eb0fae16d652c0782286e984785 (patch)
treec975a624da354ba676b9fc80ead113d8d3dd5f9a /board/elm
parent1ceade6e65668d87ce26764333bbdd4353a906a4 (diff)
downloadchrome-ec-a2bd40ce35728eb0fae16d652c0782286e984785.tar.gz
board/elm/led.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I0e97239171000b32383de7b264cb698d736d6186 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728311 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'board/elm')
-rw-r--r--board/elm/led.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/board/elm/led.c b/board/elm/led.c
index d73cc05c1b..8d7d83ffaa 100644
--- a/board/elm/led.c
+++ b/board/elm/led.c
@@ -19,10 +19,8 @@
#define LOW_BATTERY_PERMILLAGE 137
#define FULL_BATTERY_PERMILLAGE 937
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_BATTERY_LED,
- EC_LED_ID_POWER_LED
-};
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED,
+ EC_LED_ID_POWER_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -31,7 +29,7 @@ enum led_color {
BAT_LED_ORANGE,
PWR_LED_BLUE,
PWR_LED_ORANGE,
- LED_COLOR_COUNT /* Number of colors, not a color itself */
+ LED_COLOR_COUNT /* Number of colors, not a color itself */
};
static int bat_led_set(enum led_color color, int on)
@@ -111,8 +109,7 @@ static void elm_led_set_power(void)
bat_led_set(PWR_LED_ORANGE, 0);
} else if (chipset_in_state(CHIPSET_STATE_SUSPEND)) {
bat_led_set(PWR_LED_BLUE, 0);
- bat_led_set(PWR_LED_ORANGE,
- (blink_second & 3) ? 0 : 1);
+ bat_led_set(PWR_LED_ORANGE, (blink_second & 3) ? 0 : 1);
}
}
@@ -135,8 +132,9 @@ static void elm_led_set_battery(void)
/* Make the percentage approximate to UI shown */
remaining_capacity = *(int *)host_get_memmap(EC_MEMMAP_BATT_CAP);
full_charge_capacity = *(int *)host_get_memmap(EC_MEMMAP_BATT_LFCC);
- permillage = !full_charge_capacity ? 0 :
- (1000 * remaining_capacity) / full_charge_capacity;
+ permillage = !full_charge_capacity ?
+ 0 :
+ (1000 * remaining_capacity) / full_charge_capacity;
switch (charge_get_state()) {
case PWR_STATE_CHARGE:
@@ -156,12 +154,10 @@ static void elm_led_set_battery(void)
bat_led_set(BAT_LED_BLUE, 0);
if (!chipset_in_state(CHIPSET_STATE_ANY_OFF) &&
permillage <= CRITICAL_LOW_BATTERY_PERMILLAGE)
- bat_led_set(BAT_LED_ORANGE,
- (blink_second & 1) ? 0 : 1);
+ bat_led_set(BAT_LED_ORANGE, (blink_second & 1) ? 0 : 1);
else if (!chipset_in_state(CHIPSET_STATE_ANY_OFF) &&
permillage <= LOW_BATTERY_PERMILLAGE)
- bat_led_set(BAT_LED_ORANGE,
- (blink_second & 3) ? 0 : 1);
+ bat_led_set(BAT_LED_ORANGE, (blink_second & 3) ? 0 : 1);
else
bat_led_set(BAT_LED_ORANGE, 0);
break;