diff options
| author | Ryan <fauxpark@gmail.com> | 2023-09-04 10:19:59 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-04 01:19:59 +0100 |
| commit | 41bd4e35a09cc50f45112074d2b776254a3a17f8 (patch) | |
| tree | 9258c5ad40dda232e3b8271942b436bdafa6f115 /platforms/avr/drivers | |
| parent | 1e3095f9cce45fab0a566e692b1ff1c2047cfa08 (diff) | |
Clean up RGB LED type (#21859)
Diffstat (limited to 'platforms/avr/drivers')
| -rw-r--r-- | platforms/avr/drivers/ws2812_bitbang.c | 4 | ||||
| -rw-r--r-- | platforms/avr/drivers/ws2812_i2c.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/platforms/avr/drivers/ws2812_bitbang.c b/platforms/avr/drivers/ws2812_bitbang.c index aad10d86b0..116053591f 100644 --- a/platforms/avr/drivers/ws2812_bitbang.c +++ b/platforms/avr/drivers/ws2812_bitbang.c | |||
| @@ -37,13 +37,13 @@ | |||
| 37 | 37 | ||
| 38 | static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi); | 38 | static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi); |
| 39 | 39 | ||
| 40 | void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) { | 40 | void ws2812_setleds(rgb_led_t *ledarray, uint16_t number_of_leds) { |
| 41 | DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN); | 41 | DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN); |
| 42 | 42 | ||
| 43 | uint8_t masklo = ~(pinmask(WS2812_DI_PIN)) & PORTx_ADDRESS(WS2812_DI_PIN); | 43 | uint8_t masklo = ~(pinmask(WS2812_DI_PIN)) & PORTx_ADDRESS(WS2812_DI_PIN); |
| 44 | uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN); | 44 | uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN); |
| 45 | 45 | ||
| 46 | ws2812_sendarray_mask((uint8_t *)ledarray, number_of_leds * sizeof(LED_TYPE), masklo, maskhi); | 46 | ws2812_sendarray_mask((uint8_t *)ledarray, number_of_leds * sizeof(rgb_led_t), masklo, maskhi); |
| 47 | 47 | ||
| 48 | _delay_us(WS2812_TRST_US); | 48 | _delay_us(WS2812_TRST_US); |
| 49 | } | 49 | } |
diff --git a/platforms/avr/drivers/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c index f4a2fbe0b3..f52a037b8e 100644 --- a/platforms/avr/drivers/ws2812_i2c.c +++ b/platforms/avr/drivers/ws2812_i2c.c | |||
| @@ -18,12 +18,12 @@ void ws2812_init(void) { | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | // Setleds for standard RGB | 20 | // Setleds for standard RGB |
| 21 | void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { | 21 | void ws2812_setleds(rgb_led_t *ledarray, uint16_t leds) { |
| 22 | static bool s_init = false; | 22 | static bool s_init = false; |
| 23 | if (!s_init) { | 23 | if (!s_init) { |
| 24 | ws2812_init(); | 24 | ws2812_init(); |
| 25 | s_init = true; | 25 | s_init = true; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | i2c_transmit(WS2812_I2C_ADDRESS, (uint8_t *)ledarray, sizeof(LED_TYPE) * leds, WS2812_I2C_TIMEOUT); | 28 | i2c_transmit(WS2812_I2C_ADDRESS, (uint8_t *)ledarray, sizeof(rgb_led_t) * leds, WS2812_I2C_TIMEOUT); |
| 29 | } | 29 | } |
