board/anahera/led.c: Format with clang-format
BRANCH=none
TEST=none
#define LED_ON_TIME_MS (1000 * MSEC)
#define LED_ON_TICKS (LED_ON_TIME_MS / LED_TICK_INTERVAL_MS)
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_LEFT_LED,
- EC_LED_ID_RIGHT_LED
-};
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_LEFT_LED,
+ EC_LED_ID_RIGHT_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -45,10 +43,7 @@ enum led_color {
LED_COLOR_COUNT /* Number of colors, not a color itself */
};
-enum led_port {
- LEFT_PORT = 0,
- RIGHT_PORT
-};
+enum led_port { LEFT_PORT = 0, RIGHT_PORT };
static void led_set_color_battery(int port, enum led_color color)
{
@@ -155,31 +150,39 @@ static void led_set_battery(void)
*/
if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED)) {
if (charge_get_percent() < BATT_LOW_BCT)
- led_set_color_battery(RIGHT_PORT,
- (battery_ticks % LED_TICKS_PER_CYCLE
- < LED_ON_TICKS) ? LED_AMBER : LED_OFF);
+ led_set_color_battery(
+ RIGHT_PORT,
+ (battery_ticks % LED_TICKS_PER_CYCLE <
+ LED_ON_TICKS) ?
+ LED_AMBER :
+ LED_OFF);
else
led_set_color_battery(RIGHT_PORT, LED_OFF);
}
if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED)) {
if (charge_get_percent() < BATT_LOW_BCT)
- led_set_color_battery(LEFT_PORT,
- (battery_ticks % LED_TICKS_PER_CYCLE
- < LED_ON_TICKS) ? LED_AMBER : LED_OFF);
+ led_set_color_battery(
+ LEFT_PORT,
+ (battery_ticks % LED_TICKS_PER_CYCLE <
+ LED_ON_TICKS) ?
+ LED_AMBER :
+ LED_OFF);
else
led_set_color_battery(LEFT_PORT, LED_OFF);
}
break;
case PWR_STATE_ERROR:
if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED)) {
- led_set_color_battery(RIGHT_PORT, (battery_ticks & 0x1)
- ? LED_AMBER : LED_OFF);
+ led_set_color_battery(
+ RIGHT_PORT,
+ (battery_ticks & 0x1) ? LED_AMBER : LED_OFF);
}
if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED)) {
- led_set_color_battery(LEFT_PORT, (battery_ticks & 0x1)
- ? LED_AMBER : LED_OFF);
+ led_set_color_battery(LEFT_PORT, (battery_ticks & 0x1) ?
+ LED_AMBER :
+ LED_OFF);
}
break;
case PWR_STATE_CHARGE_NEAR_FULL:
@@ -187,9 +190,11 @@ static void led_set_battery(void)
break;
case PWR_STATE_IDLE: /* External power connected in IDLE */
if (chflags & CHARGE_FLAG_FORCE_IDLE)
- set_active_port_color((battery_ticks %
- LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
- LED_AMBER : LED_OFF);
+ set_active_port_color(
+ (battery_ticks % LED_TICKS_PER_CYCLE <
+ LED_ON_TICKS) ?
+ LED_AMBER :
+ LED_OFF);
else
set_active_port_color(LED_WHITE);
break;
