Use the common netstack_init

This commit is contained in:
adamdunkels 2010-02-18 23:19:03 +00:00
parent 5cf3b83733
commit fa4d4db329
3 changed files with 8 additions and 13 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* @(#)$Id: contiki-esb-default-init-net.c,v 1.13 2009/07/07 13:06:56 nifi Exp $ * @(#)$Id: contiki-esb-default-init-net.c,v 1.14 2010/02/18 23:19:03 adamdunkels Exp $
*/ */
#include "contiki-conf.h" #include "contiki-conf.h"
@ -55,8 +55,8 @@ init_net(void)
rimeaddr_t rimeaddr; rimeaddr_t rimeaddr;
int i; int i;
tr1001_init(); netstack_init();
rime_init(MAC_DRIVER.init(&tr1001_driver));
rimeaddr.u8[0] = node_id & 0xff; rimeaddr.u8[0] = node_id & 0xff;
rimeaddr.u8[1] = node_id >> 8; rimeaddr.u8[1] = node_id >> 8;
rimeaddr_set_node_addr(&rimeaddr); rimeaddr_set_node_addr(&rimeaddr);

View file

@ -56,12 +56,9 @@ void
init_net(void) init_net(void)
{ {
rimeaddr_t rimeaddr; rimeaddr_t rimeaddr;
cc2420_init();
cc2420_set_channel(RF_CHANNEL);
NETSTACK_RDC.init(); netstack_init();
NETSTACK_MAC.init(); cc2420_set_channel(RF_CHANNEL);
NETSTACK_NETWORK.init();
rimeaddr.u8[0] = node_id & 0xff; rimeaddr.u8[0] = node_id & 0xff;
rimeaddr.u8[1] = node_id >> 8; rimeaddr.u8[1] = node_id >> 8;

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: contiki-main.c,v 1.34 2010/02/18 23:10:06 adamdunkels Exp $ * $Id: contiki-main.c,v 1.35 2010/02/18 23:19:03 adamdunkels Exp $
*/ */
#include "contiki.h" #include "contiki.h"
@ -127,9 +127,7 @@ contiki_main(int flag)
ctimer_init(); ctimer_init();
NETSTACK_RDC.init(); netstack_init();
NETSTACK_MAC.init();
NETSTACK_NETWORK.init();
uip_over_mesh_init(2); uip_over_mesh_init(2);
uip_over_mesh_set_net(&meshif.ipaddr, &meshif.netmask); uip_over_mesh_set_net(&meshif.ipaddr, &meshif.netmask);