Changed the energy estimation type ENERGEST_TYPE_RECEIVE to ENERGEST_TYPE_LISTEN to highlight that energy is spent on idle listening, not just the actual reception of packets

This commit is contained in:
adamdunkels 2007-10-25 09:30:39 +00:00
parent ff006a5103
commit a9e4287cbe
6 changed files with 15 additions and 15 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: simple-cc2420.c,v 1.10 2007/09/18 10:36:31 nifi Exp $ * @(#)$Id: simple-cc2420.c,v 1.11 2007/10/25 09:30:39 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.
@ -112,7 +112,7 @@ status(void)
static void static void
on(void) on(void)
{ {
ENERGEST_ON(ENERGEST_TYPE_RECEIVE); ENERGEST_ON(ENERGEST_TYPE_LISTEN);
PRINTF("on\n"); PRINTF("on\n");
receive_on = 1; receive_on = 1;
@ -134,7 +134,7 @@ off(void)
strobe(CC2420_SRFOFF); strobe(CC2420_SRFOFF);
DISABLE_FIFOP_INT(); DISABLE_FIFOP_INT();
ENERGEST_OFF(ENERGEST_TYPE_RECEIVE); ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static u8_t locked, lock_on, lock_off; static u8_t locked, lock_on, lock_off;

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: energest.h,v 1.4 2007/05/22 20:53:04 adamdunkels Exp $ * $Id: energest.h,v 1.5 2007/10/25 09:30:39 adamdunkels Exp $
*/ */
/** /**
@ -56,7 +56,7 @@ enum energest_type {
ENERGEST_TYPE_LED_YELLOW, ENERGEST_TYPE_LED_YELLOW,
ENERGEST_TYPE_LED_RED, ENERGEST_TYPE_LED_RED,
ENERGEST_TYPE_TRANSMIT, ENERGEST_TYPE_TRANSMIT,
ENERGEST_TYPE_RECEIVE, ENERGEST_TYPE_LISTEN,
ENERGEST_TYPE_SENSORS, ENERGEST_TYPE_SENSORS,

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: tr1001-gcr.c,v 1.9 2007/08/07 11:11:19 nifi Exp $ * @(#)$Id: tr1001-gcr.c,v 1.10 2007/10/25 09:30:39 adamdunkels Exp $
*/ */
/** /**
* \addtogroup esb * \addtogroup esb
@ -243,7 +243,7 @@ tr1001_off(void)
rxoff(); rxoff();
rxclear(); rxclear();
ENERGEST_OFF(ENERGEST_TYPE_RECEIVE); ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
return 1; return 1;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -258,7 +258,7 @@ tr1001_on(void)
return 1; return 1;
} }
ENERGEST_ON(ENERGEST_TYPE_RECEIVE); ENERGEST_ON(ENERGEST_TYPE_LISTEN);
onoroff = ON; onoroff = ON;
rxon(); rxon();

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: tr1001.c,v 1.7 2007/08/07 11:11:20 nifi Exp $ * @(#)$Id: tr1001.c,v 1.8 2007/10/25 09:30:39 adamdunkels Exp $
*/ */
/** /**
* \addtogroup esb * \addtogroup esb
@ -241,7 +241,7 @@ tr1001_off(void)
rxoff(); rxoff();
rxclear(); rxclear();
ENERGEST_OFF(ENERGEST_TYPE_RECEIVE); ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
return 1; return 1;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -256,7 +256,7 @@ tr1001_on(void)
return 1; return 1;
} }
ENERGEST_ON(ENERGEST_TYPE_RECEIVE); ENERGEST_ON(ENERGEST_TYPE_LISTEN);
onoroff = ON; onoroff = ON;
rxon(); rxon();

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: energest-arch.c,v 1.1 2007/05/15 07:42:22 adamdunkels Exp $ * $Id: energest-arch.c,v 1.2 2007/10/25 09:30:39 adamdunkels Exp $
*/ */
/** /**
@ -58,7 +58,7 @@ energest_arch_current_estimate(void)
energest_type_time(ENERGEST_TYPE_LED_RED) * DEC2FIX(3,69) + energest_type_time(ENERGEST_TYPE_LED_RED) * DEC2FIX(3,69) +
energest_type_time(ENERGEST_TYPE_SENSORS) * DEC2FIX(3,76) + energest_type_time(ENERGEST_TYPE_SENSORS) * DEC2FIX(3,76) +
energest_type_time(ENERGEST_TYPE_TRANSMIT) * DEC2FIX(5,1) + energest_type_time(ENERGEST_TYPE_TRANSMIT) * DEC2FIX(5,1) +
energest_type_time(ENERGEST_TYPE_RECEIVE) * DEC2FIX(4,8); energest_type_time(ENERGEST_TYPE_LISTEN) * DEC2FIX(4,8);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
unsigned short unsigned short

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: energest-arch.c,v 1.1 2007/05/15 07:42:43 adamdunkels Exp $ * $Id: energest-arch.c,v 1.2 2007/10/25 09:30:39 adamdunkels Exp $
*/ */
/** /**
@ -58,7 +58,7 @@ energest_arch_current_estimate(void)
energest_type_time(ENERGEST_TYPE_LED_RED) * DEC2FIX(3,69) + energest_type_time(ENERGEST_TYPE_LED_RED) * DEC2FIX(3,69) +
energest_type_time(ENERGEST_TYPE_SENSORS) * DEC2FIX(3,76) + energest_type_time(ENERGEST_TYPE_SENSORS) * DEC2FIX(3,76) +
energest_type_time(ENERGEST_TYPE_TRANSMIT) * DEC2FIX(5,1) + energest_type_time(ENERGEST_TYPE_TRANSMIT) * DEC2FIX(5,1) +
energest_type_time(ENERGEST_TYPE_RECEIVE) * DEC2FIX(4,8); energest_type_time(ENERGEST_TYPE_LISTEN) * DEC2FIX(4,8);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
unsigned short unsigned short