Add init function to RGBLight driver struct (#23076)
This commit is contained in:
parent
23b7a02ebe
commit
f7cf40fa77
42 changed files with 306 additions and 93 deletions
|
|
@ -169,5 +169,6 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
|
||||
// default color
|
||||
void keyboard_post_init_user(void) {
|
||||
rgblite_init();
|
||||
rgblite_setrgb(RGB_GREEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@
|
|||
#include "ws2812.h"
|
||||
#include "color.h"
|
||||
|
||||
static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) {
|
||||
rgb_led_t leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
|
||||
ws2812_setleds(leds, RGBLED_NUM);
|
||||
static inline void rgblite_init(void) {
|
||||
ws2812_init();
|
||||
}
|
||||
|
||||
static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) {
|
||||
rgb_led_t leds[RGBLIGHT_LED_COUNT] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
|
||||
ws2812_setleds(leds, RGBLIGHT_LED_COUNT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,5 +27,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
rgblite_init();
|
||||
rgblite_increase_hue();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@
|
|||
#include "ws2812.h"
|
||||
#include "color.h"
|
||||
|
||||
static inline void rgblite_init(void) {
|
||||
ws2812_init();
|
||||
}
|
||||
|
||||
static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) {
|
||||
rgb_led_t leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
|
||||
ws2812_setleds(leds, RGBLED_NUM);
|
||||
rgb_led_t leds[RGBLIGHT_LED_COUNT] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}};
|
||||
ws2812_setleds(leds, RGBLIGHT_LED_COUNT);
|
||||
}
|
||||
|
||||
static void rgblite_increase_hue(void) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue