Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DMA stream ID calculation in ws2812_pwm (qmk#10008)
Browse files Browse the repository at this point in the history
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.
sigprof authored and noroadsleft committed Aug 29, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
domdfcoding Dominic Davis-Foster
1 parent 0810a33 commit 1e42b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/chibios/ws2812_pwm.c
Original file line number Diff line number Diff line change
@@ -180,7 +180,7 @@ void ws2812_init(void) {

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

0 comments on commit 1e42b2b

Please sign in to comment.