Bugfix: timing fixed

This commit is contained in:
adamdunkels 2010-04-08 18:23:24 +00:00
parent f2bf8965d5
commit 3670fac618
2 changed files with 5 additions and 4 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* @(#)$Id: cc2420.c,v 1.50 2010/04/04 07:49:30 adamdunkels Exp $ * @(#)$Id: cc2420.c,v 1.51 2010/04/08 18:23:24 adamdunkels Exp $
*/ */
/* /*
* This code is almost device independent and should be easy to port. * This code is almost device independent and should be easy to port.
@ -188,6 +188,7 @@ on(void)
ENABLE_FIFOP_INT(); ENABLE_FIFOP_INT();
strobe(CC2420_SRXON); strobe(CC2420_SRXON);
while(!(status() & (BV(CC2420_XOSC16M_STABLE))));
ENERGEST_ON(ENERGEST_TYPE_LISTEN); ENERGEST_ON(ENERGEST_TYPE_LISTEN);
leds_on(LEDS_GREEN); leds_on(LEDS_GREEN);
} }
@ -200,8 +201,8 @@ off(void)
/* Wait for transmission to end before turning radio off. */ /* Wait for transmission to end before turning radio off. */
while(status() & BV(CC2420_TX_ACTIVE)); while(status() & BV(CC2420_TX_ACTIVE));
strobe(CC2420_SRFOFF);
ENERGEST_OFF(ENERGEST_TYPE_LISTEN); ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
strobe(CC2420_SRFOFF);
DISABLE_FIFOP_INT(); DISABLE_FIFOP_INT();
leds_off(LEDS_GREEN); leds_off(LEDS_GREEN);

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: contikimac.c,v 1.31 2010/04/08 09:32:56 adamdunkels Exp $ * $Id: contikimac.c,v 1.32 2010/04/08 18:23:24 adamdunkels Exp $
*/ */
/** /**
@ -335,7 +335,7 @@ powercycle(struct rtimer *t, void *ptr)
} }
powercycle_turn_radio_off(); powercycle_turn_radio_off();
} }
schedule_powercycle(t, CCA_SLEEP_TIME); schedule_powercycle_fixed(t, RTIMER_NOW() + CCA_SLEEP_TIME);
/* COOJA_DEBUG_STR("yield\n");*/ /* COOJA_DEBUG_STR("yield\n");*/
PT_YIELD(&pt); PT_YIELD(&pt);
} }