board/coral/led.c: Format with clang-format
BRANCH=none
TEST=none
#define LED_POWER_ON_TICKS (LED_POWER_BLINK_ON_MSEC / HOOK_TICK_INTERVAL_MS)
#define LED_POWER_OFF_TICKS (LED_POWER_BLINK_OFF_MSEC / HOOK_TICK_INTERVAL_MS)
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_BATTERY_LED};
+const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED };
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -37,11 +36,7 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
#define GPIO_LED_COLOR_2 GPIO_BAT_LED_BLUE
#define GPIO_LED_COLOR_3 GPIO_POW_LED
-enum led_phase {
- LED_PHASE_0,
- LED_PHASE_1,
- LED_NUM_PHASES
-};
+enum led_phase { LED_PHASE_0, LED_PHASE_1, LED_NUM_PHASES };
enum led_color {
LED_OFF,
@@ -185,7 +180,8 @@ static enum led_states led_get_state(void)
charge_lvl = charge_get_percent();
/* Determine which charge state to use */
new_state = charge_lvl <= led.charge_lvl_1 ?
- STATE_CHARGING_LVL_1 : STATE_CHARGING_LVL_2;
+ STATE_CHARGING_LVL_1 :
+ STATE_CHARGING_LVL_2;
break;
case PWR_STATE_DISCHARGE_FULL:
if (extpower_is_present()) {
@@ -250,9 +246,11 @@ static void led_update_battery(void)
period = led.state_table[led.state][LED_PHASE_0].time +
led.state_table[led.state][LED_PHASE_1].time;
if (period)
- phase = ticks % period <
- led.state_table[led.state][LED_PHASE_0].time ?
- 0 : 1;
+ phase = ticks % period < led.state_table[led.state]
+ [LED_PHASE_0]
+ .time ?
+ 0 :
+ 1;
}
/* Set the color for the given state and phase */
@@ -278,8 +276,8 @@ static void led_robo_update_power(void)
* power LED is off for 600 msec, on for 3 seconds.
*/
period = LED_POWER_ON_TICKS + LED_POWER_OFF_TICKS;
- level = ticks % period < LED_POWER_OFF_TICKS ?
- LED_OFF_LVL : LED_ON_LVL;
+ level = ticks % period < LED_POWER_OFF_TICKS ? LED_OFF_LVL :
+ LED_ON_LVL;
ticks++;
} else {
level = LED_OFF_LVL;
