Ejemplo n.º 1
0
void timer_init(void)
{
	TIMER_SET_PRESCALER(TIMER_PRESCALER_64);

	TIMER_DISABLE_ON_FREEZE();
	TIMER_FANCY_FAST_CLEAR();
	
	TIMER_ENABLE();
	CLR_BITS(TIE, (TIE_C3I_MASK));
}
Ejemplo n.º 2
0
/**
     Initialize the MAC timer.  Called at powerup, or when you
   want to clear all timers.  Sets the timeout for each tick of the
   system clock.
 */
void timerInit(void)
{
    TIMER_INIT();

    // Init the PRNG
    if (NODE_TYPE == ROUTER || NODE_TYPE == COORD)
        srand(TCNT(TICKTIMER));

	TIMER_CLEAR();

    // Enable timer output compare interrupt.  -- Timer starts to interrupt as soon as Global interrup is enabled
    TIMER_ENABLE();
}