29 #define HAVE_HIRES_TIMER 72 if(timer_irq[i].user_timer_handler == handler)
75 if(!timer_irq[i].user_timer_handler)
77 timer_irq[i].
timer = 0;
79 timer_irq[i].
timer = 1;
85 printf(
"set_timers: No more timers!\n");
105 timer_irq[timer].
timer = 0;
122 timer_irq[i].
timer = 0;
158 return( _ts_to_str );
267 if(timer_irq[i].timer && timer_irq[i].user_timer_handler !=
NULL)
295 printf(
"Timers init called\n");
302 printf(
"Timers configured\n");
312 printf(
"Clock task init failed\n");
313 printf(
"Clock Installed\n");
317 printf(
"Timers enabled\n");
363 #if ! defined(HAVE_HIRES_TIMER)
TIMERS timer_irq[MAX_TIMER_CNT]
array or user timers
void execute_timers()
Execute all user timers at SYSTEM_HZ rate. Called by system task.
Master include file for project Includes all project includes and defines here.
MEMSPACE void display_ts(ts_t *val)
timespec structure in seconds.nanoseconds.
Common Linux/POSIX time functions.
MEMSPACE void install_timers_isr(void)
MEMSPACE int kill_timer(int timer)
Delete "Kill" one user timer task.
uint16_t clockid_t
type of clockid_t.
void clock_task(void)
1000HZ timer task
MEMSPACE void clock_elapsed_begin()
Store current struct timespec in __clock_elapsed.
MEMSPACE int set_timers(void(*handler)(void), int timer)
Install a user timer task.
MEMSPACE void delete_all_timers()
Clear ALL user timer tasks.
#define snprintf(s, size, format, args...)
void(* user_timer_handler)(void)
static int timers_enabled
MEMSPACE void clock_clear()
clear time and timezone to 0.
#define SYSTEM_TASK_TIC_NS
System task in HZ.
MEMSPACE int clock_settime(clockid_t clk_id, const struct timespec *ts)
Set system clock using seconds and nonoseconds - POSIX function.
MEMSPACE void disable_timers()
Disable all timer tasks.
static char _ts_to_str[32]
timespec structure in seconds.nanoseconds in string.
static int timers_configured
Math IO functions, and verious conversion code with floating point support.
volatile ts_t __clock
System Clock Time.
MEMSPACE void enable_system_task(void)
MEMSPACE void clock_elapsed_end(char *msg)
Subtract and display time difference from clock_elapesed_begin().
MEMSPACE char * ts_to_str(ts_t *val)
static ts_t __clock_elapsed
Used for elapsed time calculations.
MEMSPACE int printf(const char *format,...)
MEMSPACE void init_timers()
Setup all timers tasksi and enable interrupts.
MEMSPACE void disable_system_task(void)
tz_t __tzone
System Time Zone.
MEMSPACE void subtract_timespec(ts_t *a, ts_t *b)
subtract a-= b timespec * structures.
#define MAX_TIMER_CNT
Number of user timer tasks.
MEMSPACE int clock_getres(clockid_t clk_id, struct timespec *res)
Read clock time resolution into struct timepec *ts - POSIX function.
MEMSPACE int clock_gettime(clockid_t clk_id, struct timespec *ts)
Generic clock_gettime() function WITHOUT high resolution.
MEMSPACE void enable_timers()
Enable timer tasks.