From 42cbe85a493219286396c41ca44c6f5b65aa969f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Mar 2017 16:13:27 +0000 Subject: [PATCH 1/2] add CPU energest measurements that were lacking in this platform --- platform/avr-rss2/contiki-main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/avr-rss2/contiki-main.c b/platform/avr-rss2/contiki-main.c index a079c5a55..35628c2da 100644 --- a/platform/avr-rss2/contiki-main.c +++ b/platform/avr-rss2/contiki-main.c @@ -258,6 +258,10 @@ initialize(void) /* rtimers needed for radio cycling */ rtimer_init(); +/* after the timer intitialisation we start the cpu measurement */ + ENERGEST_ON(ENERGEST_TYPE_CPU); + + /* Initialize process subsystem */ process_init(); @@ -458,6 +462,11 @@ main(void) #if NETSTACK_CONF_WITH_IPV6 uip_ds6_nbr_t *nbr; #endif /* NETSTACK_CONF_WITH_IPV6 */ + +/* we can initialize the energest here, before the hardware */ + energest_init(); + + initialize(); while(1) { From cc4aa440a0886d406bdb706bda55d9d814b5e7f5 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 13 Mar 2017 13:54:40 +0000 Subject: [PATCH 2/2] moved energest init to after the rtimer init --- platform/avr-rss2/contiki-main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/avr-rss2/contiki-main.c b/platform/avr-rss2/contiki-main.c index 35628c2da..f220a168a 100644 --- a/platform/avr-rss2/contiki-main.c +++ b/platform/avr-rss2/contiki-main.c @@ -258,6 +258,8 @@ initialize(void) /* rtimers needed for radio cycling */ rtimer_init(); +/* we can initialize the energest arrays here */ + energest_init(); /* after the timer intitialisation we start the cpu measurement */ ENERGEST_ON(ENERGEST_TYPE_CPU); @@ -462,9 +464,6 @@ main(void) #if NETSTACK_CONF_WITH_IPV6 uip_ds6_nbr_t *nbr; #endif /* NETSTACK_CONF_WITH_IPV6 */ - -/* we can initialize the energest here, before the hardware */ - energest_init(); initialize();