summaryrefslogtreecommitdiffstats
path: root/drivers/led
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-03-20 08:12:19 +1100
committerGitHub <noreply@github.com>2023-03-20 08:12:19 +1100
commit65a80f411f03be466d0b74c5b1d44f161e19ac7e (patch)
tree8d50fe66e700167fa758eb2763a7be6eb10a2c7f /drivers/led
parent3c144fac5e2b634166f6b9cc0fc45029d63d3398 (diff)
Clean up APA102 config and add DD mapping (#20159)
Diffstat (limited to 'drivers/led')
-rw-r--r--drivers/led/apa102.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c
index f291948975..40fc68e4f1 100644
--- a/drivers/led/apa102.c
+++ b/drivers/led/apa102.c
@@ -27,7 +27,7 @@
# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103)
# define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns
# else
-# error("APA102_NOPS configuration required")
+# error APA102_NOPS configuration required
# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot
# endif
# endif
@@ -43,14 +43,14 @@
} \
} while (0)
-#define APA102_SEND_BIT(byte, bit) \
- do { \
- writePin(RGB_DI_PIN, (byte >> bit) & 1); \
- io_wait; \
- writePinHigh(RGB_CI_PIN); \
- io_wait; \
- writePinLow(RGB_CI_PIN); \
- io_wait; \
+#define APA102_SEND_BIT(byte, bit) \
+ do { \
+ writePin(APA102_DI_PIN, (byte >> bit) & 1); \
+ io_wait; \
+ writePinHigh(APA102_CI_PIN); \
+ io_wait; \
+ writePinLow(APA102_CI_PIN); \
+ io_wait; \
} while (0)
uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS;
@@ -77,11 +77,11 @@ void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) {
}
void static apa102_init(void) {
- setPinOutput(RGB_DI_PIN);
- setPinOutput(RGB_CI_PIN);
+ setPinOutput(APA102_DI_PIN);
+ setPinOutput(APA102_CI_PIN);
- writePinLow(RGB_DI_PIN);
- writePinLow(RGB_CI_PIN);
+ writePinLow(APA102_DI_PIN);
+ writePinLow(APA102_CI_PIN);
}
void apa102_set_brightness(uint8_t brightness) {