timer support function More...
#include "..\includes.h"
Functions | |
if (RecentEpoch.tv_usec >=1000000) | |
while (pActiveRecord) | |
AckTimerInterrupt () | |
time_t | GetSystemTimerRes (void) |
FUNC_RETURN | ResetTimeOutTimer (T_TimeOutTimer *tot, char symbol, time_t period, char *text) |
FUNC_RETURN | ProcessTimeout (T_TimeOutTimer *tot, time_t timeout) |
int | tv_elapsed (timeval *t, time_t s, time_t u, uint16_t retrigger) |
check if given time has elapsed More... | |
void | tv_interval (timeval *e, timeval *t1, timeval *t2) |
compute elapsed time More... | |
void | SetupSystemTime (int32_t cpuint, int port, time_t resolution) |
Setup System Time. More... | |
void | StartSystemTimer (void) |
start system timer More... | |
void | StopSystemTimer (void) |
stop system timer More... | |
void | RegisterTimerEvent (T_TimerEventHandler EventHandlerFunc, time_t sec, time_t usec) |
register a new timer event More... | |
Variables | |
timeval | RecentEpoch = {(time_t)0,(time_t)0} |
static time_t | usec_inc = (time_t)1 |
static int | SystemTimerRunning = 0 |
static T_SchedulerRecord * | gpSchedulerHead = NULL |
uint16_t | gTaskId = 1 |
const char * | TimerMessages [] |
TIMER_HANDLER_INTERRUPT | |
timer interrupt function More... | |
RecentEpoch | tv_usec = usec_inc |
_ _ _ __| | ___(_) ____ _ __ | |_ / _` | / __| |/ _` | '_ \| __| | (_| | _ \__ \ | (_| | | | | |_ \__,_|(_) ___/_|\__, |_| |_|\__| Signalprocessing |___/ Technology
if | ( | RecentEpoch.tv_usec >= | 1000000 | ) |
while | ( | pActiveRecord | ) |
AckTimerInterrupt | ( | ) |
time_t GetSystemTimerRes | ( | void | ) |
FUNC_RETURN ResetTimeOutTimer | ( | T_TimeOutTimer * | tot, |
char | symbol, | ||
time_t | period, | ||
char * | text | ||
) |
FUNC_RETURN ProcessTimeout | ( | T_TimeOutTimer * | tot, |
time_t | timeout | ||
) |
Use this function to determine if a certain period of time has elapsed since a given time stamp. The desired time period can be specified in micro second or seconds or a combination of both.
t | - timestamp |
s | - seconds |
u | - micro seconds |
retrigger | - if true (1) timeval *t is updated to current time stamp |
tv_interval() computes the elapsed time between two time values. All time values have micro seconds resolution. A carry-over is taken into account.
e | - elapsed time [OUT] |
t1 | - start time [IN] |
t2 | - end time [IN] |
void SetupSystemTime | ( | int32_t | cpuint, |
int | port, | ||
time_t | resolution | ||
) |
The system time in this application starts at compile date (see BUILD_XXX macros). For higher precision time use NTP protocol or a Real Time Clock.
cpuint | - cpu interrupt to use |
port | - timer to use |
resolution | - timer resolution |
void StartSystemTimer | ( | void | ) |
- |
void StopSystemTimer | ( | void | ) |
- |
void RegisterTimerEvent | ( | T_TimerEventHandler | EventHandlerFunc, |
time_t | sec, | ||
time_t | usec | ||
) |
EventHandlerFunc | - event handler callback function |
sec | - seconds the timer is fired |
usec | - micro seconds the timer is fired |
timeval RecentEpoch = {(time_t)0,(time_t)0} |
|
static |
|
static |
|
static |
uint16_t gTaskId = 1 |
const char* TimerMessages[] |
TIMER_HANDLER_INTERRUPT |
- |
RecentEpoch tv_usec = usec_inc |