From f5c886902836d8ab1dccb046476660f09974f1fc Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 22 May 2007 20:52:20 +0000 Subject: [PATCH] Added a function for setting the estimated energy of a component --- core/lib/energest.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/lib/energest.c b/core/lib/energest.c index 8c1754ed9..bb3ec70c7 100644 --- a/core/lib/energest.c +++ b/core/lib/energest.c @@ -28,12 +28,12 @@ * * 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 - * A brief description of what this file is. + * Implementation of the energy estimation module * \author * Adam Dunkels */ @@ -43,6 +43,7 @@ #if ENERGEST_CONF_ON +int energest_total_count; energest_t energest_total_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; } /*---------------------------------------------------------------------------*/ +void +energest_type_set(int type, unsigned long val) +{ + energest_total_time[type].current = val; +} +/*---------------------------------------------------------------------------*/ #else /* ENERGEST_CONF_ON */ +void energest_type_set(int type, unsigned long val) {} void energest_init(void) {} unsigned long energest_type_time(int type) { return 0; } #endif /* ENERGEST_CONF_ON */