diff options
author | Ryan <[email protected]> | 2024-03-18 22:03:27 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-18 22:03:27 +1100 |
commit | f7cf40fa77164d7be9358ce83f7f5939d71b38bc (patch) | |
tree | 812acccac18212ae685a4dbc5e25fbe216b787ea /drivers | |
parent | 23b7a02ebe2e6df738baa624c17e821c1573b69b (diff) | |
download | qmk_firmware-f7cf40fa77164d7be9358ce83f7f5939d71b38bc.tar.gz qmk_firmware-f7cf40fa77164d7be9358ce83f7f5939d71b38bc.zip |
Add init function to RGBLight driver struct (#23076)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/led/apa102.c | 10 | ||||
-rw-r--r-- | drivers/ws2812.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index d6d4327495..b171b07b12 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c @@ -67,7 +67,9 @@ static void apa102_send_byte(uint8_t byte) { } static void apa102_start_frame(void) { - apa102_init(); + gpio_write_pin_low(APA102_DI_PIN); + gpio_write_pin_low(APA102_CI_PIN); + for (uint16_t i = 0; i < 4; i++) { apa102_send_byte(0); } @@ -103,7 +105,8 @@ static void apa102_end_frame(uint16_t num_leds) { apa102_send_byte(0); } - apa102_init(); + gpio_write_pin_low(APA102_DI_PIN); + gpio_write_pin_low(APA102_CI_PIN); } static void apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness) { @@ -116,9 +119,6 @@ static void apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t void apa102_init(void) { gpio_set_pin_output(APA102_DI_PIN); gpio_set_pin_output(APA102_CI_PIN); - - gpio_write_pin_low(APA102_DI_PIN); - gpio_write_pin_low(APA102_CI_PIN); } void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds) { diff --git a/drivers/ws2812.h b/drivers/ws2812.h index 134de51c50..993cce8ce4 100644 --- a/drivers/ws2812.h +++ b/drivers/ws2812.h @@ -62,6 +62,8 @@ # define WS2812_LED_COUNT RGB_MATRIX_LED_COUNT #endif +void ws2812_init(void); + /* User Interface * * Input: |