MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Functions
glue_timers.c File Reference
#include <stdlib.h>
#include "stb_os.h"
#include "glue_memory.h"
#include "glue_debug.h"
#include "glue_timers.h"

Macros

#define MHEG_TIMER_MAGIC   0xc10c0000
 
#define MHEG_TIMER_MAX_WAIT   60000
 
#define MHEG_TIMER_ACCURACY   5
 
#define SIZEOF_TIMER_EVENT_MSG   1
 
#define MAX_NUM_TIMER_EVENT_MSG   100
 

Typedefs

typedef struct s_timer_info S_TIMER_INFO
 

Functions

E_MhegErr VT_TimerCreate (U32BIT millisecs, F_TimerCallback callback, void *callerRef, H_Timer *pTimerHandle)
 Set a timer for a certain number of millseconds. When the timer expires a specified callback will be called, passing the caller reference value. More...
 
E_MhegErr VT_TimerDestroy (H_Timer timerHandle)
 Destroy the specified timer. A callback will not be invoked for this timer after this function returns. More...
 
E_MhegErr VT_TimersInit (U32BIT task_priority)
 Initialise the timer component. This function must be called before any other timer functions are invoked. More...
 
E_MhegErr VT_TimersExit (void)
 Uninitialise the timer component - all resources are freed. Other timer functions must not be called after calling this function until mhegTimerInit is called again. More...
 

Detailed Description

Date
12/11/2001
Author
iwillis

Function Documentation

E_MhegErr VT_TimerCreate ( U32BIT  millisecs,
F_TimerCallback  callback,
void *  callerRef,
H_Timer *  pTimerHandle 
)

Set a timer for a certain number of millseconds. When the timer expires a specified callback will be called, passing the caller reference value.

Parameters
millisecsNumber of milliseconds before callback will be invoked.
callbackPointer to callback function to invoke when timer is triggered.
callerRefCaller reference which is passed to callback function when timer is triggered
pTimerHandlePointer to handle to this timer that must be used to destroy the timer.
Returns
MHERR_OK - Timer has been sucessfully set MHERR_ALLOCATING_MEMORY_REGION - Resource required for setting timer was not available.
E_MhegErr VT_TimerDestroy ( H_Timer  timerHandle)

Destroy the specified timer. A callback will not be invoked for this timer after this function returns.

Parameters
timerHandleHandle of the timer to be destroyed.
Returns
MHERR_OK : Timer has been sucessfully killed MHERR_BAD_PARAMETER : Invalid timer handle was passed MHERR_COMP_NOT_OPEN : Timers not initialised.
E_MhegErr VT_TimersExit ( void  )

Uninitialise the timer component - all resources are freed. Other timer functions must not be called after calling this function until mhegTimerInit is called again.

Returns
MHERR_OK : Timer component sucessfully initialised TIMER_ERR_SYSTEM_ERROR : An unexpected system error ocurred.
E_MhegErr VT_TimersInit ( U32BIT  task_priority)

Initialise the timer component. This function must be called before any other timer functions are invoked.

Returns
MHERR_OK - Timer component sucessfully initialised MHERR_COMP_ALREADY_OPEN - Timer already open. MHERR_ALLOCATING_MEMORY_REGION: A resource required for the timer was not available.