mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #13658 from fjmolinas/pr_periph_timer_cc2538
cpu/cc2538: fix GPT3 IRQ definition
This commit is contained in:
commit
b98e4bf0d1
@ -26,6 +26,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Clock system configuration
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_CORECLOCK (16000000U) /* desired core clock frequency, 16MHz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
*
|
||||
|
@ -30,7 +30,7 @@ extern "C" {
|
||||
* @name Clock system configuration
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_CORECLOCK (32000000U) /* 32MHz */
|
||||
#define CLOCK_CORECLOCK (16000000U) /* 16MHz */
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -33,7 +33,7 @@
|
||||
* @name Clock system configuration
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_CORECLOCK (32000000U) /* desired core clock frequency, 32MHz */
|
||||
#define CLOCK_CORECLOCK (16000000U) /* desired core clock frequency, 16MHz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@
|
||||
* @name Clock system configuration
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_CORECLOCK (32000000U) /* desired core clock frequency, 32MHz */
|
||||
#define CLOCK_CORECLOCK (16000000U) /* desired core clock frequency, 16MHz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -67,8 +67,21 @@ static inline void _irq_enable(tim_t tim)
|
||||
DEBUG("%s(%u)\n", __FUNCTION__, tim);
|
||||
|
||||
if (tim < TIMER_NUMOF) {
|
||||
IRQn_Type irqn = GPTIMER_0A_IRQn + (2 * tim);
|
||||
|
||||
IRQn_Type irqn;
|
||||
switch (tim) {
|
||||
case 0:
|
||||
irqn = GPTIMER_0A_IRQn;
|
||||
break;
|
||||
case 1:
|
||||
irqn = GPTIMER_1A_IRQn;
|
||||
break;
|
||||
case 2:
|
||||
irqn = GPTIMER_2A_IRQn;
|
||||
break;
|
||||
case 3:
|
||||
irqn = GPTIMER_3A_IRQn;
|
||||
break;
|
||||
}
|
||||
NVIC_SetPriority(irqn, TIMER_IRQ_PRIO);
|
||||
NVIC_EnableIRQ(irqn);
|
||||
|
||||
|
@ -21,10 +21,20 @@ BOARDS_TIMER_32kHz := \
|
||||
frdm-k22f \
|
||||
#
|
||||
|
||||
BOARDS_TIMER_16MHz := \
|
||||
cc2538dk \
|
||||
openmote-b \
|
||||
openmote-cc2538 \
|
||||
remote-reva \
|
||||
remote-revb \
|
||||
#
|
||||
|
||||
ifneq (,$(filter $(BOARDS_TIMER_25kHz),$(BOARD)))
|
||||
TIMER_SPEED ?= 250000
|
||||
else ifneq (,$(filter $(BOARDS_TIMER_32kHz),$(BOARD)))
|
||||
TIMER_SPEED ?= 32768
|
||||
else ifneq (,$(filter $(BOARDS_TIMER_16MHz),$(BOARD)))
|
||||
TIMER_SPEED ?= 16000000
|
||||
endif
|
||||
|
||||
TIMER_SPEED ?= 1000000
|
||||
|
Loading…
Reference in New Issue
Block a user