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
3 changed files with 11 additions and 12 deletions
|
@ -36,7 +36,7 @@
|
|||
*
|
||||
* 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
|
||||
neighbor_discovery_start(&tc->neighbor_discovery_conn, tc->rtmetric);
|
||||
#endif /* COLLECT_ANNOUNCEMENTS */
|
||||
neighbor_init();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* 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,15 +114,14 @@ periodic(void *ptr)
|
|||
void
|
||||
neighbor_init(void)
|
||||
{
|
||||
|
||||
static uint8_t initialized = 0;
|
||||
if(initialized == 0) {
|
||||
initialized = 1;
|
||||
memb_init(&neighbors_mem);
|
||||
list_init(neighbors_list);
|
||||
/* for(i = 0; i < MAX_NEIGHBORS; ++i) {
|
||||
rimeaddr_copy(&neighbors[i].addr, &rimeaddr_null);
|
||||
}*/
|
||||
|
||||
ctimer_set(&t, CLOCK_SECOND, periodic, NULL);
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
struct neighbor *
|
||||
neighbor_find(const rimeaddr_t *addr)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* 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();
|
||||
packetbuf_clear();
|
||||
neighbor_init();
|
||||
announcement_init();
|
||||
rime_mac = m;
|
||||
rime_mac->set_receive_function(input);
|
||||
|
|
Loading…
Reference in a new issue