From c822cd9ad142dbc409847c7d987d4090858400a2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 28 Sep 2014 08:24:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7329 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/USARTv2/uart_lld.c | 6 +++--- os/hal/ports/STM32/LLD/can_lld.c | 9 +++++++++ os/hal/ports/STM32/STM32F30x/adc_lld.c | 8 ++++---- os/hal/ports/STM32/STM32F30x/ext_lld_isr.c | 8 ++++---- os/hal/ports/STM32/STM32F30x/stm32_rcc.h | 6 +++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c index 3af72803e..c998dddce 100644 --- a/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c @@ -99,7 +99,7 @@ static uartflags_t translate_errors(uint32_t isr) { sts |= UART_FRAMING_ERROR; if (isr & USART_ISR_NE) sts |= UART_NOISE_ERROR; - if (isr & USART_ISR_LBD) + if (isr & USART_ISR_LBDF) sts |= UART_BREAK_DETECTED; return sts; } @@ -270,8 +270,8 @@ static void serve_usart_irq(UARTDriver *uartp) { isr = u->ISR; u->ICR = isr; - if (isr & (USART_ISR_LBD | USART_ISR_ORE | USART_ISR_NE | - USART_ISR_FE | USART_ISR_PE)) { + if (isr & (USART_ISR_LBDF | USART_ISR_ORE | USART_ISR_NE | + USART_ISR_FE | USART_ISR_PE)) { if (uartp->config->rxerr_cb != NULL) uartp->config->rxerr_cb(uartp, translate_errors(isr)); } diff --git a/os/hal/ports/STM32/LLD/can_lld.c b/os/hal/ports/STM32/LLD/can_lld.c index ad9752d96..b19a9fd8d 100644 --- a/os/hal/ports/STM32/LLD/can_lld.c +++ b/os/hal/ports/STM32/LLD/can_lld.c @@ -30,6 +30,15 @@ /* Driver local definitions. */ /*===========================================================================*/ +/* + * Addressing differences in the headers, they seem unable to agree on names. + */ +#if STM32_CAN_USE_CAN1 +#if !defined(CAN1) +#define CAN1 CAN +#endif +#endif + /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ diff --git a/os/hal/ports/STM32/STM32F30x/adc_lld.c b/os/hal/ports/STM32/STM32F30x/adc_lld.c index b08c55f3b..2e875f169 100644 --- a/os/hal/ports/STM32/STM32F30x/adc_lld.c +++ b/os/hal/ports/STM32/STM32F30x/adc_lld.c @@ -114,11 +114,11 @@ static void adc_lld_vreg_off(ADCDriver *adcp) { static void adc_lld_analog_on(ADCDriver *adcp) { adcp->adcm->CR |= ADC_CR_ADEN; - while ((adcp->adcm->ISR & ADC_ISR_ADRDY) == 0) + while ((adcp->adcm->ISR & ADC_ISR_ADRD) == 0) ; #if STM32_ADC_DUAL_MODE adcp->adcs->CR |= ADC_CR_ADEN; - while ((adcp->adcs->ISR & ADC_ISR_ADRDY) == 0) + while ((adcp->adcs->ISR & ADC_ISR_ADRD) == 0) ; #endif } @@ -322,7 +322,7 @@ void adc_lld_init(void) { #if STM32_ADC_USE_ADC1 /* Driver initialization.*/ adcObjectInit(&ADCD1); - ADCD1.adcc = ADC1_2; + ADCD1.adcc = ADC1_2_COMMON; ADCD1.adcm = ADC1; #if STM32_ADC_DUAL_MODE ADCD1.adcs = ADC2; @@ -339,7 +339,7 @@ void adc_lld_init(void) { #if STM32_ADC_USE_ADC3 /* Driver initialization.*/ adcObjectInit(&ADCD3); - ADCD3.adcc = ADC3_4; + ADCD3.adcc = ADC3_4_COMMON; ADCD3.adcm = ADC3; #if STM32_ADC_DUAL_MODE ADCD3.adcs = ADC4; diff --git a/os/hal/ports/STM32/STM32F30x/ext_lld_isr.c b/os/hal/ports/STM32/STM32F30x/ext_lld_isr.c index 04777f992..affe82900 100644 --- a/os/hal/ports/STM32/STM32F30x/ext_lld_isr.c +++ b/os/hal/ports/STM32/STM32F30x/ext_lld_isr.c @@ -358,7 +358,7 @@ void ext_lld_exti_irq_enable(void) { nvicEnableVector(EXTI0_IRQn, STM32_EXT_EXTI0_IRQ_PRIORITY); nvicEnableVector(EXTI1_IRQn, STM32_EXT_EXTI1_IRQ_PRIORITY); - nvicEnableVector(EXTI2_TS_IRQn, STM32_EXT_EXTI2_IRQ_PRIORITY); + nvicEnableVector(EXTI2_TSC_IRQn, STM32_EXT_EXTI2_IRQ_PRIORITY); nvicEnableVector(EXTI3_IRQn, STM32_EXT_EXTI3_IRQ_PRIORITY); nvicEnableVector(EXTI4_IRQn, STM32_EXT_EXTI4_IRQ_PRIORITY); nvicEnableVector(EXTI9_5_IRQn, STM32_EXT_EXTI5_9_IRQ_PRIORITY); @@ -366,7 +366,7 @@ void ext_lld_exti_irq_enable(void) { nvicEnableVector(PVD_IRQn, STM32_EXT_EXTI16_IRQ_PRIORITY); nvicEnableVector(RTC_Alarm_IRQn, STM32_EXT_EXTI17_IRQ_PRIORITY); nvicEnableVector(USBWakeUp_IRQn, STM32_EXT_EXTI18_IRQ_PRIORITY); - nvicEnableVector(TAMPER_STAMP_IRQn, STM32_EXT_EXTI19_IRQ_PRIORITY); + nvicEnableVector(TAMP_STAMP_IRQn, STM32_EXT_EXTI19_IRQ_PRIORITY); nvicEnableVector(RTC_WKUP_IRQn, STM32_EXT_EXTI20_IRQ_PRIORITY); nvicEnableVector(COMP1_2_3_IRQn, STM32_EXT_EXTI21_22_29_IRQ_PRIORITY); nvicEnableVector(COMP4_5_6_IRQn, STM32_EXT_EXTI30_32_IRQ_PRIORITY); @@ -382,7 +382,7 @@ void ext_lld_exti_irq_disable(void) { nvicDisableVector(EXTI0_IRQn); nvicDisableVector(EXTI1_IRQn); - nvicDisableVector(EXTI2_TS_IRQn); + nvicDisableVector(EXTI2_TSC_IRQn); nvicDisableVector(EXTI3_IRQn); nvicDisableVector(EXTI4_IRQn); nvicDisableVector(EXTI9_5_IRQn); @@ -390,7 +390,7 @@ void ext_lld_exti_irq_disable(void) { nvicDisableVector(PVD_IRQn); nvicDisableVector(RTC_Alarm_IRQn); nvicDisableVector(USBWakeUp_IRQn); - nvicDisableVector(TAMPER_STAMP_IRQn); + nvicDisableVector(TAMP_STAMP_IRQn); nvicDisableVector(RTC_WKUP_IRQn); nvicDisableVector(COMP1_2_3_IRQn); nvicDisableVector(COMP4_5_6_IRQn); diff --git a/os/hal/ports/STM32/STM32F30x/stm32_rcc.h b/os/hal/ports/STM32/STM32F30x/stm32_rcc.h index 1de834df0..a152dfadd 100644 --- a/os/hal/ports/STM32/STM32F30x/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F30x/stm32_rcc.h @@ -227,7 +227,7 @@ * * @api */ -#define rccEnableCAN1(lp) rccEnableAPB1(RCC_APB1ENR_CAN1EN, lp) +#define rccEnableCAN1(lp) rccEnableAPB1(RCC_APB1ENR_CANEN, lp) /** * @brief Disables the CAN1 peripheral clock. @@ -237,14 +237,14 @@ * * @api */ -#define rccDisableCAN1(lp) rccDisableAPB1(RCC_APB1ENR_CAN1EN, lp) +#define rccDisableCAN1(lp) rccDisableAPB1(RCC_APB1ENR_CANEN, lp) /** * @brief Resets the CAN1 peripheral. * * @api */ -#define rccResetCAN1() rccResetAPB1(RCC_APB1RSTR_CAN1RST) +#define rccResetCAN1() rccResetAPB1(RCC_APB1RSTR_CANRST) /** @} */ /** -- cgit v1.2.3