Added a function for setting the estimated energy of a component

This commit is contained in:
adamdunkels 2007-05-22 20:52:20 +00:00
parent b8d586b210
commit f5c8869028

View file

@ -28,12 +28,12 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: energest.c,v 1.2 2007/05/15 07:54:03 adamdunkels Exp $ * $Id: energest.c,v 1.3 2007/05/22 20:52:20 adamdunkels Exp $
*/ */
/** /**
* \file * \file
* A brief description of what this file is. * Implementation of the energy estimation module
* \author * \author
* Adam Dunkels <adam@sics.se> * Adam Dunkels <adam@sics.se>
*/ */
@ -43,6 +43,7 @@
#if ENERGEST_CONF_ON #if ENERGEST_CONF_ON
int energest_total_count;
energest_t energest_total_time[ENERGEST_TYPE_MAX]; energest_t energest_total_time[ENERGEST_TYPE_MAX];
energest_t energest_current_time[ENERGEST_TYPE_MAX]; energest_t energest_current_time[ENERGEST_TYPE_MAX];
@ -62,7 +63,14 @@ energest_type_time(int type)
return energest_total_time[type].current; return energest_total_time[type].current;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void
energest_type_set(int type, unsigned long val)
{
energest_total_time[type].current = val;
}
/*---------------------------------------------------------------------------*/
#else /* ENERGEST_CONF_ON */ #else /* ENERGEST_CONF_ON */
void energest_type_set(int type, unsigned long val) {}
void energest_init(void) {} void energest_init(void) {}
unsigned long energest_type_time(int type) { return 0; } unsigned long energest_type_time(int type) { return 0; }
#endif /* ENERGEST_CONF_ON */ #endif /* ENERGEST_CONF_ON */