summaryrefslogtreecommitdiff
path: root/board/nautilus/led.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 13:55:31 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-28 06:47:44 +0000
commit37124c5c1c24be671ffcf1684b8e2e6d832c45ae (patch)
tree02f227a2a6a0e752f7b080fbb744209fda7a753f /board/nautilus/led.c
parentd20926d1727120b645ee7496152d5e8dbcf8cd49 (diff)
downloadchrome-ec-37124c5c1c24be671ffcf1684b8e2e6d832c45ae.tar.gz
board/nautilus/led.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ic941c0668e2098680ac91da6abf6a118ca636ebf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728724 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'board/nautilus/led.c')
-rw-r--r--board/nautilus/led.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/board/nautilus/led.c b/board/nautilus/led.c
index 86567701f0..93cabbd4c9 100644
--- a/board/nautilus/led.c
+++ b/board/nautilus/led.c
@@ -23,9 +23,8 @@
#define LED_TOTAL_TICKS 16
#define LED_ON_TICKS 8
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_POWER_LED,
- EC_LED_ID_BATTERY_LED};
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_POWER_LED,
+ EC_LED_ID_BATTERY_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -67,7 +66,6 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
return EC_SUCCESS;
}
-
static void nautilus_led_set_power_battery(void)
{
static unsigned int power_ticks;
@@ -82,9 +80,10 @@ static void nautilus_led_set_power_battery(void)
/* Flash red on critical battery, which usually inhibits AP power-on. */
if (battery_is_present() != BP_YES ||
- charge_percent < CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON) {
- set_color(((power_ticks++ % LED_TOTAL_TICKS) < LED_ON_TICKS) ?
- LED_RED : LED_OFF);
+ charge_percent < CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON) {
+ set_color(((power_ticks++ % LED_TOTAL_TICKS) < LED_ON_TICKS) ?
+ LED_RED :
+ LED_OFF);
return;
}
@@ -92,7 +91,7 @@ static void nautilus_led_set_power_battery(void)
switch (chg_state) {
case PWR_STATE_DISCHARGE:
if ((charge_get_flags() & CHARGE_FLAG_EXTERNAL_POWER) &&
- charge_percent >= BATTERY_LEVEL_NEAR_FULL)
+ charge_percent >= BATTERY_LEVEL_NEAR_FULL)
cur_led_color = LED_GREEN;
else
cur_led_color = LED_OFF;
@@ -101,12 +100,14 @@ static void nautilus_led_set_power_battery(void)
cur_led_color = LED_RED;
break;
case PWR_STATE_ERROR:
- cur_led_color = ((power_ticks++ % LED_TOTAL_TICKS)
- < LED_ON_TICKS) ? LED_RED : LED_GREEN;
+ cur_led_color =
+ ((power_ticks++ % LED_TOTAL_TICKS) < LED_ON_TICKS) ?
+ LED_RED :
+ LED_GREEN;
break;
case PWR_STATE_CHARGE_NEAR_FULL:
case PWR_STATE_IDLE:
- if(charge_get_flags() & CHARGE_FLAG_EXTERNAL_POWER)
+ if (charge_get_flags() & CHARGE_FLAG_EXTERNAL_POWER)
cur_led_color = LED_GREEN;
else
cur_led_color = LED_OFF;
@@ -128,8 +129,8 @@ static void nautilus_led_set_power_battery(void)
static void led_tick(void)
{
if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED) &&
- led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) {
- nautilus_led_set_power_battery();
+ led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) {
+ nautilus_led_set_power_battery();
}
}