STM32: Remove one residual use of the obsoleted STM32_TIM27_FREQUENCY definition which does not work for all STM32 family members.
This commit is contained in:
parent
4c6b635298
commit
de0e2ec261
@ -847,7 +847,6 @@ static int dac_timinit(FAR struct stm32_chan_s *chan)
|
|||||||
* default) will be enabled
|
* default) will be enabled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pclk = STM32_TIM27_FREQUENCY;
|
|
||||||
regaddr = STM32_RCC_APB1ENR;
|
regaddr = STM32_RCC_APB1ENR;
|
||||||
|
|
||||||
switch (chan->timer)
|
switch (chan->timer)
|
||||||
@ -855,31 +854,37 @@ static int dac_timinit(FAR struct stm32_chan_s *chan)
|
|||||||
#ifdef NEED_TIM2
|
#ifdef NEED_TIM2
|
||||||
case 2:
|
case 2:
|
||||||
setbits = RCC_APB1ENR_TIM2EN;
|
setbits = RCC_APB1ENR_TIM2EN;
|
||||||
|
pclk = BOARD_TIM2_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM3
|
#ifdef NEED_TIM3
|
||||||
case 3:
|
case 3:
|
||||||
setbits = RCC_APB1ENR_TIM3EN;
|
setbits = RCC_APB1ENR_TIM3EN;
|
||||||
|
pclk = BOARD_TIM3_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM4
|
#ifdef NEED_TIM4
|
||||||
case 4:
|
case 4:
|
||||||
setbits = RCC_APB1ENR_TIM4EN;
|
setbits = RCC_APB1ENR_TIM4EN;
|
||||||
|
pclk = BOARD_TIM4_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM5
|
#ifdef NEED_TIM5
|
||||||
case 5:
|
case 5:
|
||||||
setbits = RCC_APB1ENR_TIM5EN;
|
setbits = RCC_APB1ENR_TIM5EN;
|
||||||
|
pclk = BOARD_TIM5_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM6
|
#ifdef NEED_TIM6
|
||||||
case 6:
|
case 6:
|
||||||
setbits = RCC_APB1ENR_TIM6EN;
|
setbits = RCC_APB1ENR_TIM6EN;
|
||||||
|
pclk = BOARD_TIM6_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM7
|
#ifdef NEED_TIM7
|
||||||
case 7:
|
case 7:
|
||||||
setbits = RCC_APB1ENR_TIM7EN;
|
setbits = RCC_APB1ENR_TIM7EN;
|
||||||
|
pclk = BOARD_TIM7_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEED_TIM8
|
#ifdef NEED_TIM8
|
||||||
@ -891,7 +896,7 @@ static int dac_timinit(FAR struct stm32_chan_s *chan)
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
aerr("ERROR: Could not enable timer\n");
|
aerr("ERROR: Could not enable timer\n");
|
||||||
break;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable the timer. */
|
/* Enable the timer. */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/olimex-stm32-e407/include/board.h
|
* configs/olimex-stm32-e407/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Modified for H407 Neil Hancock
|
* Modified for H407 Neil Hancock
|
||||||
* Modified for E407 Mateusz Szafoni
|
* Modified for E407 Mateusz Szafoni
|
||||||
@ -160,13 +160,19 @@
|
|||||||
#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||||
#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||||
|
|
||||||
/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx
|
/* Timer Frequencies, if APBx is set to 1, frequency is same as APBx
|
||||||
* otherwise frequency is 2xAPBx.
|
* otherwise frequency is 2xAPBx.
|
||||||
* Note: TIM1,8 are on APB2, others on APB1
|
* Note: TIM1,8 are on APB2, others on APB1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define STM32_TIM18_FREQUENCY STM32_HCLK_FREQUENCY
|
#define BOARD_TIM1_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
#define STM32_TIM27_FREQUENCY STM32_HCLK_FREQUENCY
|
#define BOARD_TIM2_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM3_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM4_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM5_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM6_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM7_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM8_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions ******************************************************************/
|
||||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the status LED in any
|
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the status LED in any
|
||||||
|
Loading…
Reference in New Issue
Block a user