Skip to content

Commit 1e42b2b

Browse files
sigprofnoroadsleft
authored andcommitted
Fix DMA stream ID calculation in ws2812_pwm (qmk#10008)
Some STM32 chips have STM32_DMA1_STREAM1 as the first DMA stream, others (F4xx, F7xx, H7xx) have STM32_DMA1_STREAM0. Instead of those names, use STM32_DMA_STREAM(0), which should always give the first stm32_dma_stream_t structure in the DMA streams array, so that the stream ID would be calculated correctly.
1 parent 0810a33 commit 1e42b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/chibios/ws2812_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void ws2812_init(void) {
180180

181181
// Configure DMA
182182
// dmaInit(); // Joe added this
183-
dmaStreamAlloc(WS2812_DMA_STREAM - STM32_DMA1_STREAM1, 10, NULL, NULL);
183+
dmaStreamAlloc(WS2812_DMA_STREAM - STM32_DMA_STREAM(0), 10, NULL, NULL);
184184
dmaStreamSetPeripheral(WS2812_DMA_STREAM, &(WS2812_PWM_DRIVER.tim->CCR[WS2812_PWM_CHANNEL - 1])); // Ziel ist der An-Zeit im Cap-Comp-Register
185185
dmaStreamSetMemory0(WS2812_DMA_STREAM, ws2812_frame_buffer);
186186
dmaStreamSetTransactionSize(WS2812_DMA_STREAM, WS2812_BIT_N);

0 commit comments

Comments
 (0)