Added function names to timer debug output

This commit is contained in:
goldsimon
2010-01-08 14:08:47 +00:00
parent 8a34c16aee
commit 79c88cdcfd
2 changed files with 49 additions and 2 deletions

View File

@@ -42,6 +42,10 @@
extern "C" {
#endif
#ifndef LWIP_DEBUG_TIMERNAMES
#define LWIP_DEBUG_TIMERNAMES (LWIP_DEBUG && SYS_DEBUG)
#endif
typedef void (* sys_timeout_handler)(void *arg);
struct sys_timeo {
@@ -49,10 +53,20 @@ struct sys_timeo {
u32_t time;
sys_timeout_handler h;
void *arg;
#if LWIP_DEBUG_TIMERNAMES
const char* handler_name;
#endif /* LWIP_DEBUG_TIMERNAMES */
};
void sys_timeouts_init(void);
#if LWIP_DEBUG_TIMERNAMES
void sys_timeout_debug(u32_t msecs, sys_timeout_handler h, void *arg, const char* handler_name);
#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)
#else /* LWIP_DEBUG_TIMERNAMES */
void sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
#endif /* LWIP_DEBUG_TIMERNAMES */
void sys_untimeout(sys_timeout_handler h, void *arg);
#if NO_SYS
void sys_check_timeouts(void);