zephyr/shim/src/led_driver/led.c: Format with clang-format
BRANCH=none
TEST=none
@@ -37,8 +37,7 @@ enum led_extra_flag_t {
LED_CHFLAG_DEFAULT,
};
-#define DECLARE_PINS_NODE(id) \
-extern struct led_pins_node_t PINS_NODE(id);
+#define DECLARE_PINS_NODE(id) extern struct led_pins_node_t PINS_NODE(id);
#if DT_HAS_COMPAT_STATUS_OKAY(COMPAT_PWM_LED)
DT_FOREACH_CHILD(PWM_LED_PINS_NODE, DECLARE_PINS_NODE)
@@ -80,14 +79,14 @@ struct node_prop_t {
* HOOT_TICK_INTERVAL_MS
*/
-#define PERIOD_VAL(id) COND_CODE_1(DT_NODE_HAS_PROP(id, period_ms), \
+#define PERIOD_VAL(id) \
+ COND_CODE_1(DT_NODE_HAS_PROP(id, period_ms), \
(DT_PROP(id, period_ms) / HOOK_TICK_INTERVAL_MS), (0))
#define LED_PERIOD(color_num, state_id) \
PERIOD_VAL(DT_CHILD(state_id, color_##color_num))
-#define LED_PLUS_PERIOD(color_num, state_id) \
- + LED_PERIOD(color_num, state_id)
+#define LED_PLUS_PERIOD(color_num, state_id) +LED_PERIOD(color_num, state_id)
#define ACC_PERIOD(color_num, state_id) \
(0 LISTIFY(color_num, LED_PLUS_PERIOD, (), state_id))
@@ -107,26 +106,23 @@ struct node_prop_t {
* Initialize node_array struct with prop listed in dts
*/
#define SET_LED_VALUES(state_id) \
-{ \
- .pwr_state = GET_PROP(state_id, charge_state), \
+ { .pwr_state = GET_PROP(state_id, charge_state), \
.chipset_state = GET_PROP(state_id, chipset_state), \
.led_extra_flag = GET_PROP(state_id, extra_flag), \
- .batt_lvl = COND_CODE_1( \
- DT_NODE_HAS_PROP(state_id, batt_lvl), \
- (DT_PROP(state_id, batt_lvl)), ({-1, -1})), \
- .charge_port = COND_CODE_1( \
- DT_NODE_HAS_PROP(state_id, charge_port), \
+ .batt_lvl = COND_CODE_1(DT_NODE_HAS_PROP(state_id, batt_lvl), \
+ (DT_PROP(state_id, batt_lvl)), \
+ ({ -1, -1 })), \
+ .charge_port = COND_CODE_1(DT_NODE_HAS_PROP(state_id, charge_port), \
(DT_PROP(state_id, charge_port)), (-1)), \
- .led_colors = {LED_COLOR_INIT(0, 1, state_id), \
+ .led_colors = { \
+ LED_COLOR_INIT(0, 1, state_id), \
LED_COLOR_INIT(1, 2, state_id), \
LED_COLOR_INIT(2, 3, state_id), \
LED_COLOR_INIT(3, 4, state_id), \
- } \
-},
+ } },
-static const struct node_prop_t node_array[] = {
- DT_FOREACH_CHILD(LED_COLOR_NODE, SET_LED_VALUES)
-};
+static const struct node_prop_t node_array[] = { DT_FOREACH_CHILD(
+ LED_COLOR_NODE, SET_LED_VALUES) };
static enum power_state get_chipset_state(void)
{
