Skip to content

Commit

Permalink
timeout: Add function for deinit system timers
Browse files Browse the repository at this point in the history
Picked from 2749568f
Ref IDF-4847
  • Loading branch information
freakyxue authored and david-cermak committed Aug 16, 2022
1 parent e8c46a5 commit 5446609
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/timeouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ void sys_timeouts_init(void)
}
}

/** Deinitialize this module */
void sys_timeouts_deinit(void)
{
size_t i;
/* tcp_tmr() at index 0 is started on demand */
for (i = (LWIP_TCP ? 1 : 0); i < LWIP_ARRAYSIZE(lwip_cyclic_timers); i++) {
sys_untimeout(lwip_cyclic_timer, LWIP_CONST_CAST(void *, &lwip_cyclic_timers[i]));
}
}
/**
* Create a one-shot timer (aka timeout). Timeouts are processed in the
* following cases:
Expand Down
1 change: 1 addition & 0 deletions src/include/lwip/timeouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ struct sys_timeo {
};

void sys_timeouts_init(void);
void sys_timeouts_deinit(void);

#if LWIP_DEBUG_TIMERNAMES
void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);
Expand Down

0 comments on commit 5446609

Please sign in to comment.