diff options
| author | Ryan <fauxpark@gmail.com> | 2024-03-18 22:03:27 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-18 22:03:27 +1100 |
| commit | f7cf40fa77164d7be9358ce83f7f5939d71b38bc (patch) | |
| tree | 812acccac18212ae685a4dbc5e25fbe216b787ea /quantum/rgblight | |
| parent | 23b7a02ebe2e6df738baa624c17e821c1573b69b (diff) | |
Add init function to RGBLight driver struct (#23076)
Diffstat (limited to 'quantum/rgblight')
| -rw-r--r-- | quantum/rgblight/rgblight.c | 2 | ||||
| -rw-r--r-- | quantum/rgblight/rgblight_drivers.c | 2 | ||||
| -rw-r--r-- | quantum/rgblight/rgblight_drivers.h | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c index 530cb04688..28b58feea6 100644 --- a/quantum/rgblight/rgblight.c +++ b/quantum/rgblight/rgblight.c | |||
| @@ -247,6 +247,8 @@ void rgblight_init(void) { | |||
| 247 | rgblight_mode_noeeprom(rgblight_config.mode); | 247 | rgblight_mode_noeeprom(rgblight_config.mode); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | rgblight_driver.init(); | ||
| 251 | |||
| 250 | is_rgblight_initialized = true; | 252 | is_rgblight_initialized = true; |
| 251 | } | 253 | } |
| 252 | 254 | ||
diff --git a/quantum/rgblight/rgblight_drivers.c b/quantum/rgblight/rgblight_drivers.c index 45b60e1a5f..8902b8f842 100644 --- a/quantum/rgblight/rgblight_drivers.c +++ b/quantum/rgblight/rgblight_drivers.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | # include "ws2812.h" | 7 | # include "ws2812.h" |
| 8 | 8 | ||
| 9 | const rgblight_driver_t rgblight_driver = { | 9 | const rgblight_driver_t rgblight_driver = { |
| 10 | .init = ws2812_init, | ||
| 10 | .setleds = ws2812_setleds, | 11 | .setleds = ws2812_setleds, |
| 11 | }; | 12 | }; |
| 12 | 13 | ||
| @@ -14,6 +15,7 @@ const rgblight_driver_t rgblight_driver = { | |||
| 14 | # include "apa102.h" | 15 | # include "apa102.h" |
| 15 | 16 | ||
| 16 | const rgblight_driver_t rgblight_driver = { | 17 | const rgblight_driver_t rgblight_driver = { |
| 18 | .init = apa102_init, | ||
| 17 | .setleds = apa102_setleds, | 19 | .setleds = apa102_setleds, |
| 18 | }; | 20 | }; |
| 19 | 21 | ||
diff --git a/quantum/rgblight/rgblight_drivers.h b/quantum/rgblight/rgblight_drivers.h index f7125a6f3d..af28b918e1 100644 --- a/quantum/rgblight/rgblight_drivers.h +++ b/quantum/rgblight/rgblight_drivers.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "color.h" | 7 | #include "color.h" |
| 8 | 8 | ||
| 9 | typedef struct { | 9 | typedef struct { |
| 10 | void (*init)(void); | ||
| 10 | void (*setleds)(rgb_led_t *ledarray, uint16_t number_of_leds); | 11 | void (*setleds)(rgb_led_t *ledarray, uint16_t number_of_leds); |
| 11 | } rgblight_driver_t; | 12 | } rgblight_driver_t; |
| 12 | 13 | ||
