mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
ctk-curses: fix build
Including curses.h in contiki-conf.h (required for COLOR_* defines) induced a symbol name clash with neighbor-attr.c on "timeout". Renamed timeout to neighbor_timeout.
This commit is contained in:
parent
1c5d6a9db7
commit
9ffaa96475
@ -48,7 +48,7 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
|
||||
static uint16_t timeout = 0;
|
||||
static uint16_t neighbor_timeout = 0;
|
||||
|
||||
MEMB(neighbor_addr_mem, struct neighbor_addr, NEIGHBOR_ATTR_MAX_NEIGHBORS);
|
||||
|
||||
@ -209,7 +209,7 @@ neighbor_attr_tick(const rimeaddr_t * addr)
|
||||
uint16_t
|
||||
neighbor_attr_get_timeout(void)
|
||||
{
|
||||
return timeout;
|
||||
return neighbor_timeout;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static struct ctimer ct;
|
||||
@ -218,12 +218,12 @@ static struct ctimer ct;
|
||||
static void
|
||||
timeout_check(void *ptr)
|
||||
{
|
||||
if(timeout > 0) {
|
||||
if(neighbor_timeout > 0) {
|
||||
struct neighbor_addr *item = neighbor_attr_list_neighbors();
|
||||
|
||||
while(item != NULL) {
|
||||
item->time += TIMEOUT_SECONDS;
|
||||
if(item->time >= timeout) {
|
||||
if(item->time >= neighbor_timeout) {
|
||||
struct neighbor_addr *next_item = item->next;
|
||||
|
||||
list_remove(neighbor_addrs, item);
|
||||
@ -240,11 +240,11 @@ timeout_check(void *ptr)
|
||||
void
|
||||
neighbor_attr_set_timeout(uint16_t time)
|
||||
{
|
||||
if(timeout == 0 && time > 0) {
|
||||
if(neighbor_timeout == 0 && time > 0) {
|
||||
ctimer_set(&ct, TIMEOUT_SECONDS * CLOCK_SECOND, timeout_check, NULL);
|
||||
} else if(timeout > 0 && time == 0) {
|
||||
} else if(neighbor_timeout > 0 && time == 0) {
|
||||
ctimer_stop(&ct);
|
||||
}
|
||||
timeout = time;
|
||||
neighbor_timeout = time;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user