#include <compiler.h>
Macros | |
#define | INVALID_TIMER_ID 0xFFFFFFFF |
#define | TIMER_HZ 4 |
Enumerations | |
enum | { TIMEOUT_ONESHOT, TIMEOUT_PERIODIC } |
Functions | |
void | timer_cancel_timeout (U32 id) |
void | timer_delay (U32 ms) |
U32 | timer_get_ms (void) |
void | timer_init (void(*tick_isr)(void *ctx), void *ctx) |
int | timer_interval_passed (U32 old, U32 new, U32 diff) |
U32 | timer_mod (U32 id, U32 ms, U8 type, void(*cb)(void *ctx), void *ctx) |
void | timer_poll (void) |
Called from application main loop to invoke any scheduled timeout cbs. More... | |
U32 | timer_sched_timeout_cb (U32 ms, U8 type, void(*cb)(void *ctx), void *ctx) |
#define INVALID_TIMER_ID 0xFFFFFFFF |
Referenced by timer_mod().
#define TIMER_HZ 4 |
void timer_cancel_timeout | ( | U32 | id | ) |
References timeout_t::expired, timer_t::timeout, and TIMER.
Referenced by timer_mod(), and ttcp_destroy().
void timer_delay | ( | U32 | ms | ) |
References timer_t::MS_PER_TICK, timer_t::tick, and TIMER.
U32 timer_get_ms | ( | void | ) |
References timer_t::MS_PER_TICK, timer_t::tick, and TIMER.
Referenced by cmd_ping(), init_ping_info(), main(), ping_recv(), ping_send(), poll(), print_stats(), sys_now(), tcp_accept_cb(), tcp_connect_cb(), ttcp_print_stats(), udp_recv_cb(), and udp_send_data().
void timer_init | ( | void(*)(void *ctx) | tick_isr, |
void * | ctx | ||
) |
References ARRAY_SIZE, Assert, ctx, timer_t::ctx, timeout_t::expired, INTC_register_interrupt(), irq_handler(), timer_t::MS_PER_TICK, rtc_enable(), rtc_enable_interrupt(), rtc_init(), RTC_OSC_RC, rtc_set_top_value(), timer_t::tick_isr, timer_t::timeout, and TIMER.
Referenced by main().
References cb, timeout_t::expired, INVALID_TIMER_ID, timer_t::timeout, TIMER, timer_cancel_timeout(), and timer_sched_timeout_cb().
void timer_poll | ( | void | ) |
Called from application main loop to invoke any scheduled timeout cbs.
This function might be called as often as possible rather than at each tick to support the timeout value '0', e.g a timeout within less than one tick.
References ARRAY_SIZE, timeout_t::cb, timeout_t::ctx, timeout_t::expire_at_tick, timeout_t::expired, i, timeout_t::tick, timer_t::tick, timer_t::timeout, TIMEOUT_PERIODIC, TIMER, and timeout_t::type.
References Assert, cb, timeout_t::cb, ctx, timeout_t::ctx, timer_t::timeout, TIMER, and timer_sched_timeout().
Referenced by start_ip_stack(), tcp_send_data(), tcp_timeout_cb(), timer_mod(), and udp_send_data().