diff --git a/core/hwtimer.c b/core/hwtimer.c index b9d3b12cc7..43dc04f956 100644 --- a/core/hwtimer.c +++ b/core/hwtimer.c @@ -43,8 +43,8 @@ typedef struct hwtimer_t { void *data; } hwtimer_t; -static hwtimer_t timer[ARCH_MAXTIMERS]; -static int lifo[ARCH_MAXTIMERS + 1]; +static hwtimer_t timer[HWTIMER_MAXTIMERS]; +static int lifo[HWTIMER_MAXTIMERS + 1]; /*---------------------------------------------------------------------------*/ @@ -100,9 +100,9 @@ void hwtimer_init_comp(uint32_t fcpu) { hwtimer_arch_init(multiplexer, fcpu); - lifo_init(lifo, ARCH_MAXTIMERS); + lifo_init(lifo, HWTIMER_MAXTIMERS); - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { lifo_insert(lifo, i); } } diff --git a/cpu/arm_common/include/hwtimer_cpu.h b/cpu/arm_common/include/hwtimer_cpu.h index 3f2c489095..c0cb4f45f2 100644 --- a/cpu/arm_common/include/hwtimer_cpu.h +++ b/cpu/arm_common/include/hwtimer_cpu.h @@ -11,7 +11,7 @@ #ifndef HWTIMER_CPU_H_ #define HWTIMER_CPU_H_ -#define ARCH_MAXTIMERS 4 +#define HWTIMER_MAXTIMERS 4 #define HWTIMER_SPEED 1000000 #define HWTIMER_MAXTICKS (0xFFFFFFFF) diff --git a/cpu/cc430/hwtimer_cc430.c b/cpu/cc430/hwtimer_cc430.c index 44d8e8aaf5..781135fcb9 100644 --- a/cpu/cc430/hwtimer_cc430.c +++ b/cpu/cc430/hwtimer_cc430.c @@ -43,7 +43,7 @@ void timerA_init(void) volatile unsigned int *ccr = &TA0CCR0; volatile unsigned int *ctl = &TA0CCTL0; - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { *(ccr + i) = 0; *(ctl + i) &= ~(CCIFG); *(ctl + i) &= ~(CCIE); diff --git a/cpu/lpc1768/include/hwtimer_cpu.h b/cpu/lpc1768/include/hwtimer_cpu.h index da9d658ca4..fed2d22009 100644 --- a/cpu/lpc1768/include/hwtimer_cpu.h +++ b/cpu/lpc1768/include/hwtimer_cpu.h @@ -1,7 +1,7 @@ #ifndef HWTIMER_CPU_H_ #define HWTIMER_CPU_H_ -#define ARCH_MAXTIMERS 3 +#define HWTIMER_MAXTIMERS 3 #define HWTIMER_SPEED 1000000 #define HWTIMER_MAXTICKS (0xFFFFFFFF) diff --git a/cpu/msp430-common/hwtimer_cpu.c b/cpu/msp430-common/hwtimer_cpu.c index 39f6b48096..40c6867b41 100644 --- a/cpu/msp430-common/hwtimer_cpu.c +++ b/cpu/msp430-common/hwtimer_cpu.c @@ -22,7 +22,7 @@ See the file LICENSE in the top level directory for more details. void (*int_handler)(int); extern void timerA_init(void); -uint16_t overflow_interrupt[ARCH_MAXTIMERS+1]; +uint16_t overflow_interrupt[HWTIMER_MAXTIMERS+1]; uint16_t timer_round; #ifdef CC430 @@ -87,14 +87,14 @@ void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) void hwtimer_arch_enable_interrupt(void) { - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { timer_enable_interrupt(i); } } void hwtimer_arch_disable_interrupt(void) { - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { timer_disable_interrupt(i); } } diff --git a/cpu/msp430-common/include/hwtimer_cpu.h b/cpu/msp430-common/include/hwtimer_cpu.h index c8e125da28..95d5dd392b 100644 --- a/cpu/msp430-common/include/hwtimer_cpu.h +++ b/cpu/msp430-common/include/hwtimer_cpu.h @@ -18,19 +18,19 @@ See the file LICENSE in the top level directory for more details. #include "cpu.h" #ifdef __MSP430_HAS_TA2__ -#define ARCH_MAXTIMERS 2 +#define HWTIMER_MAXTIMERS 2 #endif #ifdef __MSP430_HAS_TA3__ -#define ARCH_MAXTIMERS 3 +#define HWTIMER_MAXTIMERS 3 #endif #ifdef __MSP430_HAS_T0A5__ -#define ARCH_MAXTIMERS 5 +#define HWTIMER_MAXTIMERS 5 #endif -#ifndef ARCH_MAXTIMERS -#warning "ARCH_MAXTIMERS UNSET!" -#define ARCH_MAXTIMERS 0 +#ifndef HWTIMER_MAXTIMERS +#warning "HWTIMER_MAXTIMERS UNSET!" +#define HWTIMER_MAXTIMERS 0 #endif #define HWTIMER_SPEED (F_RC_OSCILLATOR) diff --git a/cpu/msp430x16x/hwtimer_msp430.c b/cpu/msp430x16x/hwtimer_msp430.c index 4173cf8b3a..5522c30b23 100644 --- a/cpu/msp430x16x/hwtimer_msp430.c +++ b/cpu/msp430x16x/hwtimer_msp430.c @@ -28,7 +28,7 @@ static uint32_t ticks = 0; extern void (*int_handler)(int); extern void timer_unset(short timer); -extern uint16_t overflow_interrupt[ARCH_MAXTIMERS+1]; +extern uint16_t overflow_interrupt[HWTIMER_MAXTIMERS+1]; extern uint16_t timer_round; void timerA_init(void) @@ -41,7 +41,7 @@ void timerA_init(void) TACTL &= ~TAIFG; // Clear the IFG TACTL &= ~TAIE; // Clear the IFG - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { ccr = &TACCR0 + (i); ctl = &TACCTL0 + (i); *ccr = 0; diff --git a/cpu/native/hwtimer_cpu.c b/cpu/native/hwtimer_cpu.c index f1fa7188f1..86f593a786 100644 --- a/cpu/native/hwtimer_cpu.c +++ b/cpu/native/hwtimer_cpu.c @@ -51,8 +51,8 @@ static unsigned long native_hwtimer_now; static unsigned long time_null; -static struct itimerval native_hwtimer[ARCH_MAXTIMERS]; -static int native_hwtimer_isset[ARCH_MAXTIMERS]; +static struct itimerval native_hwtimer[HWTIMER_MAXTIMERS]; +static int native_hwtimer_isset[HWTIMER_MAXTIMERS]; static int next_timer = -1; static void (*int_handler)(int); @@ -126,7 +126,7 @@ void schedule_timer(void) { /* try to find *an active* timer */ next_timer = -1; - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { if (native_hwtimer_isset[i] == 1) { next_timer = i; break; @@ -139,7 +139,7 @@ void schedule_timer(void) } /* find the next pending timer (next_timer now points to *a* valid pending timer) */ - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { if ( (native_hwtimer_isset[i] == 1) && (tv2ticks(&(native_hwtimer[i].it_value)) < tv2ticks(&(native_hwtimer[next_timer].it_value))) @@ -315,7 +315,7 @@ void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) hwtimer_arch_disable_interrupt(); int_handler = handler; - for (int i = 0; i < ARCH_MAXTIMERS; i++) { + for (int i = 0; i < HWTIMER_MAXTIMERS; i++) { native_hwtimer_isset[i] = 0; native_hwtimer[i].it_interval.tv_sec = 0; native_hwtimer[i].it_interval.tv_usec = 0; diff --git a/cpu/native/include/hwtimer_cpu.h b/cpu/native/include/hwtimer_cpu.h index 32afd3feb3..73aca95fd4 100644 --- a/cpu/native/include/hwtimer_cpu.h +++ b/cpu/native/include/hwtimer_cpu.h @@ -18,7 +18,7 @@ #define HWTIMER_CPU_H_ /* TODO: choose more appropriate values here? */ -#define ARCH_MAXTIMERS 4 +#define HWTIMER_MAXTIMERS 4 #define HWTIMER_SPEED 1000000 #define HWTIMER_MAXTICKS (0xFFFFFFFF)