moved initialization of ctimer to allow MAC layer to use ctimers

This commit is contained in:
nifi 2007-11-15 13:07:42 +00:00
parent c645cad175
commit a6d827fa1f
5 changed files with 13 additions and 9 deletions

View File

@ -33,7 +33,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: rime.c,v 1.11 2007/09/26 11:34:49 nifi Exp $ * $Id: rime.c,v 1.12 2007/11/15 13:07:42 nifi Exp $
*/ */
/** /**
@ -64,7 +64,6 @@ input(const struct mac_driver *r)
void void
rime_init(const struct mac_driver *m) rime_init(const struct mac_driver *m)
{ {
ctimer_init();
queuebuf_init(); queuebuf_init();
route_init(); route_init();
rimebuf_clear(); rimebuf_clear();

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: contiki-sky-main.c,v 1.1 2007/10/25 12:56:28 adamdunkels Exp $ * @(#)$Id: contiki-sky-main.c,v 1.2 2007/11/15 13:08:38 nifi Exp $
*/ */
#include <signal.h> #include <signal.h>
@ -126,7 +126,7 @@ main(int argc, char **argv)
#endif /* WITH_UIP */ #endif /* WITH_UIP */
printf("Starting %s " printf("Starting %s "
"($Id: contiki-sky-main.c,v 1.1 2007/10/25 12:56:28 adamdunkels Exp $)\n", __FILE__); "($Id: contiki-sky-main.c,v 1.2 2007/11/15 13:08:38 nifi Exp $)\n", __FILE__);
ds2411_init(); ds2411_init();
sensors_light_init(); sensors_light_init();
sht11_init(); sht11_init();
@ -161,6 +161,7 @@ main(int argc, char **argv)
process_init(); process_init();
process_start(&etimer_process, NULL); process_start(&etimer_process, NULL);
process_start(&sensors_process, NULL); process_start(&sensors_process, NULL);
ctimer_init();
set_rime_addr(); set_rime_addr();

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: init-net-rime.c,v 1.3 2007/08/23 07:35:26 fros4943 Exp $ * @(#)$Id: init-net-rime.c,v 1.4 2007/11/15 13:11:41 nifi Exp $
*/ */
#include "contiki.h" #include "contiki.h"
@ -43,6 +43,8 @@ init_net(void)
{ {
rimeaddr_t rimeaddr; rimeaddr_t rimeaddr;
ctimer_init();
nullmac_init(&cooja_driver); nullmac_init(&cooja_driver);
rime_init(&nullmac_driver); rime_init(&nullmac_driver);

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.7 2007/08/07 11:17:54 nifi Exp $ * @(#)$Id: contiki-esb-default-init-net.c,v 1.8 2007/11/15 13:11:41 nifi Exp $
*/ */
#include "contiki-esb.h" #include "contiki-esb.h"
@ -41,9 +41,10 @@ init_net(void)
{ {
rimeaddr_t rimeaddr; rimeaddr_t rimeaddr;
ctimer_init();
tr1001_init(); tr1001_init();
nullmac_init(&tr1001_driver); rime_init(nullmac_init(&tr1001_driver));
rime_init(&nullmac_driver);
rimeaddr.u8[0] = node_id >> 8; rimeaddr.u8[0] = node_id >> 8;
rimeaddr.u8[1] = node_id & 0xff; rimeaddr.u8[1] = node_id & 0xff;
rimeaddr_set_node_addr(&rimeaddr); rimeaddr_set_node_addr(&rimeaddr);

View File

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: contiki-main.c,v 1.17 2007/10/25 08:26:49 zhitao Exp $ * $Id: contiki-main.c,v 1.18 2007/11/15 13:11:42 nifi Exp $
*/ */
#include "contiki.h" #include "contiki.h"
@ -96,6 +96,7 @@ contiki_main(int flag)
uip_init(); uip_init();
ctimer_init();
rime_init(nullmac_init(&ethernode_driver)); rime_init(nullmac_init(&ethernode_driver));
uip_over_mesh_init(0); uip_over_mesh_init(0);