aboutsummaryrefslogtreecommitdiff
path: root/drivers/led/apa102.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/led/apa102.c')
-rw-r--r--drivers/led/apa102.c10
1 files changed, 5 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) {