diff --git a/cpu/msp430/cc2420-arch-sfd.c b/cpu/msp430/cc2420-arch-sfd.c index abd8b30ce..023130baa 100644 --- a/cpu/msp430/cc2420-arch-sfd.c +++ b/cpu/msp430/cc2420-arch-sfd.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)$Id: cc2420-arch-sfd.c,v 1.1 2009/12/05 19:42:56 adamdunkels Exp $ + * @(#)$Id: cc2420-arch-sfd.c,v 1.2 2010/01/19 13:11:01 adamdunkels Exp $ */ #include @@ -35,6 +35,7 @@ #include "dev/spi.h" #include "dev/cc2420.h" +uint8_t cc2420_arch_sfd_counter; uint16_t cc2420_arch_sfd_start_time; uint16_t cc2420_arch_sfd_end_time; @@ -48,8 +49,10 @@ cc24240_timerb1_interrupt(void) /* always read TBIV to clear IFG */ tbiv = TBIV; if(SFD_IS_1) { + cc2420_arch_sfd_counter++; cc2420_arch_sfd_start_time = TBCCR1; } else { + cc2420_arch_sfd_counter = 0; cc2420_arch_sfd_end_time = TBCCR1; } ENERGEST_OFF(ENERGEST_TYPE_IRQ); diff --git a/cpu/msp430/cc2420-arch-sfd.h b/cpu/msp430/cc2420-arch-sfd.h index f72602ed7..d11038dfc 100644 --- a/cpu/msp430/cc2420-arch-sfd.h +++ b/cpu/msp430/cc2420-arch-sfd.h @@ -26,11 +26,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)$Id: cc2420-arch-sfd.h,v 1.1 2009/12/05 19:42:56 adamdunkels Exp $ + * @(#)$Id: cc2420-arch-sfd.h,v 1.2 2010/01/19 13:11:01 adamdunkels Exp $ */ #ifndef CC2420_ARCH_SFD_H #define CC2420_ARCH_SFD_H +extern uint8_t cc2420_arch_sfd_counter; +extern uint16_t cc2420_arch_sfd_start_time; +extern uint16_t cc2420_arch_sfd_end_time; + void cc2420_arch_sfd_init(void); #endif /* CC2420_ARCH_SFD_H */