#include <stdint.h>
#include <rtc.h>
#include <intc.h>
#include <ports/avr32/timer.h>
#include "lwip/init.h"
#include "lwip/sys.h"
Data Structures | |
struct | timeout_t |
struct | timer_t |
Macros | |
#define | ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) |
Functions | |
static void | irq_handler (void) |
U32 | sys_now (void) |
Returns the current time in milliseconds, may be the same as sys_jiffies or at least based on it. More... | |
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... | |
static U32 | timer_sched_timeout (U32 ms, U8 type) |
U32 | timer_sched_timeout_cb (U32 ms, U8 type, void(*cb)(void *ctx), void *ctx) |
Variables | |
static struct timer_t | TIMER |
Referenced by console_add_cmd(), console_schedule_cmd(), timer_init(), timer_poll(), and timer_sched_timeout().
|
static |
References timer_t::ctx, timer_t::tick, timer_t::tick_isr, and TIMER.
Referenced by timer_init().
U32 sys_now | ( | void | ) |
Returns the current time in milliseconds, may be the same as sys_jiffies or at least based on it.
Returns the current time in milliseconds.
References timer_get_ms().
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 ARRAY_SIZE, Assert, timeout_t::expire_at_tick, timeout_t::expired, timer_t::MS_PER_TICK, timeout_t::tick, timer_t::tick, timer_t::timeout, TIMEOUT_ONESHOT, TIMEOUT_PERIODIC, TIMER, and timeout_t::type.
Referenced by timer_sched_timeout_cb().
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().
|
static |
Referenced by irq_handler(), timer_cancel_timeout(), timer_delay(), timer_get_ms(), timer_init(), timer_mod(), timer_poll(), timer_sched_timeout(), and timer_sched_timeout_cb().