Formatting
This commit is contained in:
parent
6e6858b399
commit
0f86643d26
2 changed files with 131 additions and 133 deletions
|
@ -97,7 +97,8 @@ static inline int is31fl3733_led_off(const struct device *dev, uint32_t led){
|
||||||
is31fl3733_write_page_reg(dev, offset, leds[offset]);
|
is31fl3733_write_page_reg(dev, offset, leds[offset]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int is31fl3733_led_set_color(const struct device *dev,uint32_t led, uint8_t num_of_colors, const uint8_t *colors){
|
static int is31fl3733_led_set_color(const struct device *dev, uint32_t led, uint8_t num_of_colors,
|
||||||
|
const uint8_t *colors) {
|
||||||
uint8_t cs = led - ((led / 16) * 16);
|
uint8_t cs = led - ((led / 16) * 16);
|
||||||
uint8_t sw = (led / 16) * 3;
|
uint8_t sw = (led / 16) * 3;
|
||||||
uint8_t offset_red = sw * IS31FL3733_CS + cs;
|
uint8_t offset_red = sw * IS31FL3733_CS + cs;
|
||||||
|
@ -168,16 +169,13 @@ static const struct led_driver_api is31fl3733_led_api = {
|
||||||
.set_color = is31fl3733_led_set_color,
|
.set_color = is31fl3733_led_set_color,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define IS31FL3733_INIT(inst) \
|
#define IS31FL3733_INIT(inst) \
|
||||||
static struct is31fl3733_data is31fl3733_led_data_##inst; \
|
static struct is31fl3733_data is31fl3733_led_data_##inst; \
|
||||||
static const struct is31fl3733_config is31fl3733_config_##inst = { \
|
static const struct is31fl3733_config is31fl3733_config_##inst = { \
|
||||||
.bus_name = DT_INST_BUS_LABEL(inst), \
|
.bus_name = DT_INST_BUS_LABEL(inst), \
|
||||||
.reg = DT_INST_REG_ADDR(inst), \
|
.reg = DT_INST_REG_ADDR(inst), \
|
||||||
}; \
|
}; \
|
||||||
DEVICE_AND_API_INIT(is31fl3733_led##inst, DT_INST_LABEL(inst), \
|
DEVICE_AND_API_INIT(is31fl3733_led##inst, DT_INST_LABEL(inst), &is31fl3733_led_init, \
|
||||||
&is31fl3733_led_init, &is31fl3733_led_data_##inst, \
|
&is31fl3733_led_data_##inst, &is31fl3733_config_##inst, POST_KERNEL, \
|
||||||
&is31fl3733_config_##inst, POST_KERNEL, CONFIG_LED_INIT_PRIORITY, \
|
CONFIG_LED_INIT_PRIORITY, &is31fl3733_led_api);
|
||||||
&is31fl3733_led_api);
|
|
||||||
DT_INST_FOREACH_STATUS_OKAY(IS31FL3733_INIT)
|
DT_INST_FOREACH_STATUS_OKAY(IS31FL3733_INIT)
|
||||||
|
|
Loading…
Add table
Reference in a new issue