Commit 888a04e7 authored by Niclas Finne's avatar Niclas Finne
Browse files

energest: removed support for ENERGEST_CONF_LEVELDEVICE_LEVELS

parent fafe4bb1
......@@ -695,9 +695,6 @@ cc2420_transmit(unsigned short payload_len)
accurate measurement of the transmission time.*/
wait_for_transmission();
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
ENERGEST_OFF_LEVEL(ENERGEST_TYPE_TRANSMIT,cc2420_get_txpower());
#endif
ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
if(receive_on) {
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
......
......@@ -45,9 +45,6 @@
int energest_total_count;
energest_t energest_total_time[ENERGEST_TYPE_MAX];
rtimer_clock_t energest_current_time[ENERGEST_TYPE_MAX];
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
energest_t energest_leveldevice_current_leveltime[ENERGEST_CONF_LEVELDEVICE_LEVELS];
#endif
unsigned char energest_current_mode[ENERGEST_TYPE_MAX];
/*---------------------------------------------------------------------------*/
......@@ -59,45 +56,20 @@ energest_init(void)
energest_total_time[i].current = energest_current_time[i] = 0;
energest_current_mode[i] = 0;
}
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
for(i = 0; i < ENERGEST_CONF_LEVELDEVICE_LEVELS; ++i) {
energest_leveldevice_current_leveltime[i].current = 0;
}
#endif
}
/*---------------------------------------------------------------------------*/
unsigned long
energest_type_time(int type)
{
/* Note: does not support ENERGEST_CONF_LEVELDEVICE_LEVELS! */
#ifndef ENERGEST_CONF_LEVELDEVICE_LEVELS
if(energest_current_mode[type]) {
rtimer_clock_t now = RTIMER_NOW();
energest_total_time[type].current += (rtimer_clock_t)
(now - energest_current_time[type]);
energest_current_time[type] = now;
}
#endif /* ENERGEST_CONF_LEVELDEVICE_LEVELS */
return energest_total_time[type].current;
}
/*---------------------------------------------------------------------------*/
unsigned long
energest_leveldevice_leveltime(int powerlevel)
{
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
return energest_leveldevice_current_leveltime[powerlevel].current;
#else
return 0;
#endif
}
/*---------------------------------------------------------------------------*/
void
energest_type_set(int type, unsigned long val)
{
energest_total_time[type].current = val;
}
/*---------------------------------------------------------------------------*/
/* Note: does not support ENERGEST_CONF_LEVELDEVICE_LEVELS! */
void
energest_flush(void)
{
......
......@@ -63,9 +63,6 @@ enum energest_type {
void energest_init(void);
unsigned long energest_type_time(int type);
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
unsigned long energest_leveldevice_leveltime(int powerlevel);
#endif
void energest_type_set(int type, unsigned long value);
void energest_flush(void);
......@@ -75,10 +72,6 @@ extern energest_t energest_total_time[ENERGEST_TYPE_MAX];
extern rtimer_clock_t energest_current_time[ENERGEST_TYPE_MAX];
extern unsigned char energest_current_mode[ENERGEST_TYPE_MAX];
#ifdef ENERGEST_CONF_LEVELDEVICE_LEVELS
extern energest_t energest_leveldevice_current_leveltime[ENERGEST_CONF_LEVELDEVICE_LEVELS];
#endif
#define ENERGEST_ON(type) do { \
/*++energest_total_count;*/ \
energest_current_time[type] = RTIMER_NOW(); \
......@@ -91,11 +84,6 @@ extern energest_t energest_leveldevice_current_leveltime[ENERGEST_CONF_LEVELDEVI
energest_current_mode[type] = 0; \
} while(0)
#define ENERGEST_OFF_LEVEL(type,level) do { \
energest_leveldevice_current_leveltime[level].current += (rtimer_clock_t)(RTIMER_NOW() - \
energest_current_time[type]); \
energest_current_mode[type] = 0; \
} while(0)
#define ENERGEST_SWITCH(type_off, type_on) do { \
rtimer_clock_t energest_local_variable_now = RTIMER_NOW(); \
......@@ -111,7 +99,6 @@ extern energest_t energest_leveldevice_current_leveltime[ENERGEST_CONF_LEVELDEVI
#else /* ENERGEST_CONF_ON */
#define ENERGEST_ON(type) do { } while(0)
#define ENERGEST_OFF(type) do { } while(0)
#define ENERGEST_OFF_LEVEL(type,level) do { } while(0)
#define ENERGEST_SWITCH(type_off, type_on) do { } while(0)
#endif /* ENERGEST_CONF_ON */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment