From c0783e284155821fd18dd23aa17c1a6053be2b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20=27Morty=27=20Str=C3=BCbe?= Date: Mon, 14 Apr 2014 15:48:03 +0200 Subject: [PATCH] sky: Initialize energest as early as possible If energest is initialized too late, the radio is not accounted until the first switch. This is a problem when the radio is always listening. --- platform/sky/contiki-sky-main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/sky/contiki-sky-main.c b/platform/sky/contiki-sky-main.c index 639d0d108..d589ca037 100644 --- a/platform/sky/contiki-sky-main.c +++ b/platform/sky/contiki-sky-main.c @@ -283,6 +283,10 @@ main(int argc, char **argv) * Hardware initialization done! */ + /* Initialize energest first (but after rtimer) + */ + energest_init(); + ENERGEST_ON(ENERGEST_TYPE_CPU); #if WITH_TINYOS_AUTO_IDS node_id = TOS_NODE_ID; @@ -418,9 +422,6 @@ main(int argc, char **argv) } #endif /* WITH_UIP */ - energest_init(); - ENERGEST_ON(ENERGEST_TYPE_CPU); - watchdog_start(); NETSTACK_LLSEC.bootstrap(start_network_layer);