Skip to content

Commit

Permalink
sky: Initialize energest as early as possible
Browse files Browse the repository at this point in the history
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.
cmorty committed Oct 9, 2014
1 parent e803a65 commit c0783e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions platform/sky/contiki-sky-main.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit c0783e2

Please sign in to comment.