From c5b954a8670abe277daa06f4eea2b48d761e3175 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 14 Jun 2012 18:32:01 -0400 Subject: Port test-usart-dma.cpp for STM32F2. Too ugly? Meh. Signed-off-by: Marti Bolivar --- examples/test-usart-dma.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'examples') diff --git a/examples/test-usart-dma.cpp b/examples/test-usart-dma.cpp index 04117c3..d10dc68 100644 --- a/examples/test-usart-dma.cpp +++ b/examples/test-usart-dma.cpp @@ -35,9 +35,18 @@ // your purposes. HardwareSerial *serial = &Serial2; #define USART_DMA_DEV DMA1 +#if STM32_MCU_SERIES == STM32_SERIES_F1 // On STM32F1 microcontrollers (like what's on Maple and Maple Mini), // dma tubes are channels. #define USART_RX_DMA_TUBE DMA_CH6 +#elif (STM32_MCU_SERIES == STM32_SERIES_F2 || \ + STM32_MCU_SERIES == STM32_SERIES_F4) +// On STM32F2 and STM32F4 microcontrollers (Maple 2 will have an F4), +// dma tubes are streams. +#define USART_RX_DMA_TUBE DMA_S5 +#else +#error "unsupported stm32 series" +#endif // The serial port will make a DMA request each time it receives data. // This is the dma_request_src we use to tell the DMA tube to handle // that DMA request. -- cgit v1.2.3