1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #2593 from haukepetersen/fix_stm32f0_timerdef

cpu/stm32f0: cleanup for timer IRQ macro
This commit is contained in:
Thomas Eichinger 2015-03-13 14:23:41 +01:00
commit 1eac81b562
2 changed files with 3 additions and 14 deletions

View File

@ -40,7 +40,7 @@ extern "C" {
*/
#define TIMER_NUMOF (1U)
#define TIMER_0_EN 1
#define TIMER_1_EN 0
#define TIMER_IRQ_PRIO 1
/* Timer 0 configuration */
#define TIMER_0_DEV TIM2
@ -50,17 +50,6 @@ extern "C" {
#define TIMER_0_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_TIM2EN)
#define TIMER_0_ISR isr_tim2
#define TIMER_0_IRQ_CHAN TIM2_IRQn
#define TIMER_0_IRQ_PRIO 1
/* Timer 1 configuration */
#define TIMER_1_DEV TIMx /* TODO */
#define TIMER_1_CHANNELS
#define TIMER_1_PRESCALER (47U)
#define TIMER_1_MAX_VALUE (0xffff)
#define TIMER_1_CLKEN()
#define TIMER_1_ISR
#define TIMER_1_IRQCHAN
#define TIMER_1_IRQ_PRIO
/** @} */
/**

View File

@ -52,7 +52,7 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
/* enable timer peripheral clock */
TIMER_0_CLKEN();
/* set timer's IRQ priority */
NVIC_SetPriority(TIMER_0_IRQ_CHAN, TIMER_0_IRQ_PRIO);
NVIC_SetPriority(TIMER_0_IRQ_CHAN, TIMER_IRQ_PRIO);
/* select timer */
timer = TIMER_0_DEV;
break;
@ -62,7 +62,7 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
/* enable timer peripheral clock */
TIMER_1_CLKEN();
/* set timer's IRQ priority */
NVIC_SetPriority(TIMER_1_IRQ_CHAN, TIMER_1_IRQ_PRIO);
NVIC_SetPriority(TIMER_1_IRQ_CHAN, TIMER_IRQ_PRIO);
/* select timer */
timer = TIMER_1_DEV;
break;