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

Reduce variable scope in init function

This commit is contained in:
Kévin Roussel 2014-09-30 11:35:29 +02:00
parent d101b30dd8
commit 1fb12b770e

View File

@ -32,16 +32,14 @@ extern void timer_unset(short timer);
void timerA_init(void)
{
volatile unsigned int *ccr;
volatile unsigned int *ctl;
TACTL = TASSEL_1 + TACLR; /* Clear the timer counter, set ACLK */
TACTL &= ~TAIFG; /* Clear the IFG */
TACTL &= ~TAIE; /* Disable TAIE (overflow IRQ) */
for (int i = 0; i < HWTIMER_MAXTIMERS; i++) {
ccr = &TACCR0 + (i);
ctl = &TACCTL0 + (i);
volatile unsigned int *ccr = &TACCR0 + (i);
volatile unsigned int *ctl = &TACCTL0 + (i);
*ccr = 0;
*ctl &= ~(CCIFG);
*ctl &= ~(CCIE);