Moved the neigbor_init() call to the collect module, since it is the only one that currently uses it
This commit is contained in:
parent
1a34dbe550
commit
d7b7b05d0e
|
@ -36,7 +36,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: collect.c,v 1.30 2010/02/02 21:44:05 adamdunkels Exp $
|
* $Id: collect.c,v 1.31 2010/02/03 20:38:33 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -419,6 +419,7 @@ collect_open(struct collect_conn *tc, uint16_t channels,
|
||||||
#else
|
#else
|
||||||
neighbor_discovery_start(&tc->neighbor_discovery_conn, tc->rtmetric);
|
neighbor_discovery_start(&tc->neighbor_discovery_conn, tc->rtmetric);
|
||||||
#endif /* COLLECT_ANNOUNCEMENTS */
|
#endif /* COLLECT_ANNOUNCEMENTS */
|
||||||
|
neighbor_init();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: neighbor.c,v 1.21 2009/11/08 19:40:17 adamdunkels Exp $
|
* $Id: neighbor.c,v 1.22 2010/02/03 20:38:33 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,14 +114,13 @@ periodic(void *ptr)
|
||||||
void
|
void
|
||||||
neighbor_init(void)
|
neighbor_init(void)
|
||||||
{
|
{
|
||||||
|
static uint8_t initialized = 0;
|
||||||
memb_init(&neighbors_mem);
|
if(initialized == 0) {
|
||||||
list_init(neighbors_list);
|
initialized = 1;
|
||||||
/* for(i = 0; i < MAX_NEIGHBORS; ++i) {
|
memb_init(&neighbors_mem);
|
||||||
rimeaddr_copy(&neighbors[i].addr, &rimeaddr_null);
|
list_init(neighbors_list);
|
||||||
}*/
|
ctimer_set(&t, CLOCK_SECOND, periodic, NULL);
|
||||||
|
}
|
||||||
ctimer_set(&t, CLOCK_SECOND, periodic, NULL);
|
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
struct neighbor *
|
struct neighbor *
|
||||||
|
|
|
@ -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.23 2010/01/25 13:54:26 adamdunkels Exp $
|
* $Id: rime.c,v 1.24 2010/02/03 20:38:33 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,6 @@ rime_init(const struct mac_driver *m)
|
||||||
{
|
{
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
packetbuf_clear();
|
packetbuf_clear();
|
||||||
neighbor_init();
|
|
||||||
announcement_init();
|
announcement_init();
|
||||||
rime_mac = m;
|
rime_mac = m;
|
||||||
rime_mac->set_receive_function(input);
|
rime_mac->set_receive_function(input);
|
||||||
|
|
Loading…
Reference in a new issue