diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2022-10-20 23:17:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 08:17:51 +1100 |
commit | c4f99f06ab4f260ad9ee8c4281073c5d82431e57 (patch) | |
tree | 64bfd736a26fc155f08c76bb58054aaa6d0a5769 /platforms/chibios/drivers/vendor/RP | |
parent | a7d6643e3d230f4eceb9ee0e644c25b317b354b4 (diff) |
ws2812: replace RGBLED_NUM with driver-owned constant to decouple driver from RGBLEDs/RGBMATRIX defines (#18036)
Diffstat (limited to 'platforms/chibios/drivers/vendor/RP')
-rw-r--r-- | platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c b/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c index bc34eded14..4470e2c826 100644 --- a/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c +++ b/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c @@ -36,10 +36,10 @@ static int state_machine = -1; // clang-format off static const uint16_t ws2812_program_instructions[] = { // .wrap_target - 0x7221, // 0: out x, 1 side 1 [2] - 0x0123, // 1: jmp !x, 3 side 0 [1] - 0x0400, // 2: jmp 0 side 0 [4] - 0xb442, // 3: nop side 1 [4] + 0x7221, // 0: out x, 1 side 1 [2] + 0x0123, // 1: jmp !x, 3 side 0 [1] + 0x0400, // 2: jmp 0 side 0 [4] + 0xb442, // 3: nop side 1 [4] // .wrap }; @@ -62,7 +62,7 @@ static const pio_program_t ws2812_program = { .origin = -1, }; -static uint32_t WS2812_BUFFER[RGBLED_NUM]; +static uint32_t WS2812_BUFFER[WS2812_LED_COUNT]; static const rp_dma_channel_t* WS2812_DMA_CHANNEL; bool ws2812_init(void) { @@ -154,7 +154,7 @@ static inline void sync_ws2812_transfer(void) { // Abort the synchronization if we have to wait longer than the total // count of LEDs in millisecounds. This is safely much longer than it // would take to push all the data out. - if (unlikely(timer_elapsed_fast(start) > RGBLED_NUM)) { + if (unlikely(timer_elapsed_fast(start) > WS2812_LED_COUNT)) { dprintln("ERROR: WS2812 DMA transfer has stalled, aborting!"); dmaChannelDisableX(WS2812_DMA_CHANNEL); return; |