From 15df82cdf3f5b5d81af2cc235fbfe7643cd044b9 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Tue, 25 Aug 2020 12:02:32 +0300 Subject: Fix DMA stream ID calculation in ws2812_pwm (#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. --- drivers/chibios/ws2812_pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/chibios/ws2812_pwm.c') diff --git a/drivers/chibios/ws2812_pwm.c b/drivers/chibios/ws2812_pwm.c index d93fa2473..bfb44ce4a 100644 --- a/drivers/chibios/ws2812_pwm.c +++ b/drivers/chibios/ws2812_pwm.c @@ -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); -- cgit v1.2.3