moved rtimer from TimerB to TimerA so that TimerB subsystem is free for other uses

This commit is contained in:
joxe 2008-12-02 12:44:48 +00:00
parent f0f9314e7e
commit 23b7db88d5
3 changed files with 11 additions and 22 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rtimer-arch.c,v 1.7 2008/07/04 00:02:21 adamdunkels Exp $
* $Id: rtimer-arch.c,v 1.8 2008/12/02 12:44:48 joxe Exp $
*/
/**
@ -53,11 +53,9 @@
#endif
/*---------------------------------------------------------------------------*/
interrupt(TIMERB1_VECTOR) timerb1 (void) {
interrupt(TIMERA0_VECTOR) timera0 (void) {
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(TBIV == 2) {
rtimer_run_next();
}
rtimer_run_next();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
@ -66,18 +64,8 @@ rtimer_arch_init(void)
{
dint();
/* Select SMCLK (2.4576MHz), clear TAR; This makes the rtimer count
the number of processor cycles executed by the CPU. */
//TBCTL = TBSSEL1 | TBCLR;
/* Select ACLK 32768Hz clock, divide by 8 */
TBCTL = TBSSEL0 | TBCLR | ID_3;
/* CCR1 interrupt enabled, interrupt occurs when timer equals CCR1. */
TBCCTL1 = CCIE;
/* Start Timer_B in continuous mode. */
TBCTL |= MC1;
/* CCR0 interrupt enabled, interrupt occurs when timer equals CCR0. */
TACCTL0 = CCIE;
/* Enable interrupts. */
eint();
@ -87,5 +75,5 @@ void
rtimer_arch_schedule(rtimer_clock_t t)
{
PRINTF("rtimer_arch_schedule time %u\n", t);
TBCCR1 = t;
TACCR0 = t;
}