mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Added IRQ and SERIAL component.
This commit is contained in:
parent
f5c8869028
commit
9b6f6d6822
@ -28,12 +28,12 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: energest.h,v 1.3 2007/05/15 07:54:03 adamdunkels Exp $
|
||||
* $Id: energest.h,v 1.4 2007/05/22 20:53:04 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* A brief description of what this file is.
|
||||
* Header file for the energy estimation mechanism
|
||||
* \author
|
||||
* Adam Dunkels <adam@sics.se>
|
||||
*/
|
||||
@ -41,6 +41,8 @@
|
||||
#ifndef __ENERGEST_H__
|
||||
#define __ENERGEST_H__
|
||||
|
||||
#include "rtimer-arch.h"
|
||||
|
||||
typedef struct {
|
||||
/* unsigned long cummulative[2];*/
|
||||
unsigned long current;
|
||||
@ -49,6 +51,7 @@ typedef struct {
|
||||
enum energest_type {
|
||||
ENERGEST_TYPE_CPU,
|
||||
ENERGEST_TYPE_LPM,
|
||||
ENERGEST_TYPE_IRQ,
|
||||
ENERGEST_TYPE_LED_GREEN,
|
||||
ENERGEST_TYPE_LED_YELLOW,
|
||||
ENERGEST_TYPE_LED_RED,
|
||||
@ -57,21 +60,26 @@ enum energest_type {
|
||||
|
||||
ENERGEST_TYPE_SENSORS,
|
||||
|
||||
ENERGEST_TYPE_SERIAL,
|
||||
|
||||
ENERGEST_TYPE_MAX
|
||||
};
|
||||
|
||||
void energest_init(void);
|
||||
unsigned long energest_type_time(int type);
|
||||
void energest_type_set(int type, unsigned long value);
|
||||
|
||||
#if ENERGEST_CONF_ON
|
||||
/*extern int energest_total_count;*/
|
||||
extern energest_t energest_total_time[ENERGEST_TYPE_MAX];
|
||||
extern unsigned short energest_current_time[ENERGEST_TYPE_MAX];
|
||||
|
||||
#define ENERGEST_ON(type) do { \
|
||||
energest_current_time[type] = energest_arch_now(); \
|
||||
/*++energest_total_count;*/ \
|
||||
energest_current_time[type] = RTIMER_NOW(); \
|
||||
} while(0)
|
||||
#define ENERGEST_OFF(type) do { \
|
||||
energest_total_time[type].current += (unsigned long)((signed short)energest_arch_now() - \
|
||||
energest_total_time[type].current += (unsigned long)((signed short)RTIMER_NOW() - \
|
||||
(signed short)energest_current_time[type]); \
|
||||
} while(0)
|
||||
#else /* ENERGEST_CONF_ON */
|
||||
|
Loading…
Reference in New Issue
Block a user