void HardwareTimer::enable(void (*fptr)(void)) {
    if (!__valid)
        return;
    
    //set user function pointer
    if (__user_fptr != NULL)
        delete __user_fptr;
    if (fptr != NULL)
        __user_fptr = new FunctionPointer(fptr);

    __init_timer(); //Do hardware-specific initialization
        
    __enabled = true;
}
template <typename T> void HardwareTimer::enable(T *tptr, void (T::*mptr)(void)) {
    if (!__valid)
        return;
        
    if (__enabled)
        disable();
        
    //set user function pointer
    if (__user_fptr != NULL)
        delete __user_fptr;
    if (tptr != NULL && mptr != NULL)
        __user_fptr = new FunctionPointer(tptr, mptr);

    __init_timer(); //Do hardware-specific initialization
    
    __enabled = true;
}
void systemInitClock(void)
{
	ticks.ticks = 0;	
	__init_timer();	
}
예제 #4
0
/**
 * tti_init_timer - initialize a timer
 * @timer: the timer to be initialized
 *
 * tti_init_timer() must be done to a timer prior calling *any* of the
 * other timer functions.
 */
void tti_init_timer(struct tti_timer_list *timer)
{
    debug_init(timer);
    
    __init_timer(timer);
}