📄 tmse.c
字号:
/* Move input timer pointer into internal pointer. */ timer = (TM_APP_TCB *) timer_ptr; /* Check the parameters to the delete timer function. */ if (timer == NU_NULL) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else if (timer -> tm_id != TM_TIMER_ID) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else /* Call the actual delete timer function. */ status = TMS_Delete_Timer(timer_ptr); /* Return completion status. */ return(status);}/*************************************************************************//* *//* FUNCTION *//* *//* TMSE_Reset_Timer *//* *//* DESCRIPTION *//* *//* This function performs error checking on the parameters supplied *//* to the reset timer function. *//* *//* CALLED BY *//* *//* Application *//* *//* CALLS *//* *//* TMS_Reset_Timer Actual reset timer function *//* *//* INPUTS *//* *//* timer_ptr Timer control block pointer *//* expiration_routine Timer expiration routine *//* initial_time Initial expiration time *//* reschedule_time Reschedule expiration time *//* enable Automatic enable option *//* *//* OUTPUTS *//* *//* NU_INVALID_TIMER Indicates timer pointer is *//* invalid *//* NU_INVALID_FUNCTION Indicates that expiration *//* function pointer is NULL *//* NU_INVALID_ENABLE Indicates enable parameter *//* is invalid *//* *//* HISTORY *//* *//* DATE REMARKS *//* *//* 03-01-1993 Created initial version 1.0 *//* 04-19-1993 Verified version 1.0 *//* 03-01-1994 Changed function interface, *//* resulting in version 1.1 *//* *//* 03-18-1994 Verified version 1.1 *//* *//*************************************************************************/STATUS TMSE_Reset_Timer(NU_TIMER *timer_ptr, VOID (*expiration_routine)(UNSIGNED), UNSIGNED initial_time, UNSIGNED reschedule_time, OPTION enable){TM_APP_TCB *timer; /* Timer contorl block ptr */STATUS status; /* Completion status */ /* Move input timer pointer into internal pointer. */ timer = (TM_APP_TCB *) timer_ptr; /* Check the parameters to the reset timer function. */ if (timer == NU_NULL) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else if (timer -> tm_id != TM_TIMER_ID) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else if (initial_time == 0) /* Invalid time value. */ status = NU_INVALID_OPERATION; else if (expiration_routine == NU_NULL) /* Invalid expiration function pointer. */ status = NU_INVALID_FUNCTION; else if ((enable != NU_ENABLE_TIMER) && (enable != NU_DISABLE_TIMER)) /* Invalid enable parameter. */ status = NU_INVALID_ENABLE; else /* Call the actual reset timer function. */ status = TMS_Reset_Timer(timer_ptr, expiration_routine, initial_time, reschedule_time, enable); /* Return completion status. */ return(status);}/*************************************************************************//* *//* FUNCTION *//* *//* TMSE_Control_Timer *//* *//* DESCRIPTION *//* *//* This function performs error checking on the parameters supplied *//* to the control timer function. *//* *//* CALLED BY *//* *//* Application *//* *//* CALLS *//* *//* TMS_Control_Timer Actual control timer function*//* *//* INPUTS *//* *//* timer_ptr Timer control block pointer *//* enable Disable/enable timer option *//* *//* OUTPUTS *//* *//* NU_INVALID_TIMER Indicates the timer pointer *//* is invalid *//* NU_INVALID_ENABLE Indicates enable parameter *//* is invalid *//* *//* HISTORY *//* *//* DATE REMARKS *//* *//* 03-01-1993 Created initial version 1.0 *//* 04-19-1993 Verified version 1.0 *//* 03-01-1994 Changed function interface, *//* resulting in version 1.1 *//* *//* 03-18-1994 Verified version 1.1 *//* *//*************************************************************************/STATUS TMSE_Control_Timer(NU_TIMER *timer_ptr, OPTION enable){TM_APP_TCB *timer; /* Timer control block ptr */STATUS status; /* Completion status */ /* Move input timer pointer to internal pointer. */ timer = (TM_APP_TCB *) timer_ptr; /* Check the parameters to the reset timer function. */ if (timer == NU_NULL) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else if (timer -> tm_id != TM_TIMER_ID) /* Invalid timer pointer. */ status = NU_INVALID_TIMER; else if ((enable != NU_ENABLE_TIMER) && (enable != NU_DISABLE_TIMER)) /* Invalid enable parameter. */ status = NU_INVALID_ENABLE; else /* Call actual control timer function. */ status = TMS_Control_Timer(timer_ptr, enable); /* Return completion status. */ return(status);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -