git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4233 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
7a6a1679a4
commit
5a7b2c4fba
|
@ -98,17 +98,13 @@ static const SerialConfig default_config =
|
|||
static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
||||
USART_TypeDef *u = sdp->usart;
|
||||
|
||||
/*
|
||||
* Baud rate setting.
|
||||
*/
|
||||
/* Baud rate setting.*/
|
||||
if (sdp->usart == USART1)
|
||||
u->BRR = STM32_USART1CLK / config->sc_speed;
|
||||
else
|
||||
u->BRR = STM32_PCLK / config->sc_speed;
|
||||
|
||||
/*
|
||||
* Note that some bits are enforced.
|
||||
*/
|
||||
/* Note that some bits are enforced.*/
|
||||
u->CR1 = config->sc_cr1 | USART_CR1_UE | USART_CR1_PEIE |
|
||||
USART_CR1_RXNEIE | USART_CR1_TE |
|
||||
USART_CR1_RE;
|
||||
|
@ -215,9 +211,7 @@ static void serve_interrupt(SerialDriver *sdp) {
|
|||
static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
||||
USART_TypeDef *u = sdp->usart;
|
||||
|
||||
/*
|
||||
* Baud rate setting.
|
||||
*/
|
||||
/* Baud rate setting.*/
|
||||
#if STM32_HAS_USART6
|
||||
if ((sdp->usart == USART1) || (sdp->usart == USART6))
|
||||
#else
|
||||
|
@ -227,9 +221,7 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
|||
else
|
||||
u->BRR = STM32_PCLK1 / config->sc_speed;
|
||||
|
||||
/*
|
||||
* Note that some bits are enforced.
|
||||
*/
|
||||
/* Note that some bits are enforced.*/
|
||||
u->CR1 = config->sc_cr1 | USART_CR1_UE | USART_CR1_PEIE |
|
||||
USART_CR1_RXNEIE | USART_CR1_TE |
|
||||
USART_CR1_RE;
|
||||
|
|
|
@ -223,18 +223,15 @@
|
|||
*/
|
||||
/* ADC attributes.*/
|
||||
#define STM32_HAS_ADC1 TRUE
|
||||
#define STM32_ADC1_DMA_DEFAULT STM32_DMA_STREAM_ID(1, 0)
|
||||
#define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) | \
|
||||
STM32_DMA_STREAM_ID_MSK(1, 1))
|
||||
#define STM32_ADC1_DMA_CHN 0x00000000
|
||||
|
||||
#define STM32_HAS_ADC2 FALSE
|
||||
#define STM32_ADC2_DMA_DEFAULT 0
|
||||
#define STM32_ADC2_DMA_MSK 0x00000000
|
||||
#define STM32_ADC2_DMA_CHN 0x00000000
|
||||
|
||||
#define STM32_HAS_ADC3 FALSE
|
||||
#define STM32_ADC3_DMA_DEFAULT 0
|
||||
#define STM32_ADC3_DMA_MSK 0x00000000
|
||||
#define STM32_ADC3_DMA_CHN 0x00000000
|
||||
|
||||
|
|
Loading…
Reference in New Issue