📄 tmt.s
字号:
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_Timer Value of count-down timer */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Read_Timer
_TMT_Read_Timer:
;UNSIGNED TMT_Read_Timer(void)
;{
;
; /* Return the current value of the count-down timer. */
; return(TMD_Timer);
;
MOVE.L _TMD_Timer,D0 ; Pickup the current timer value
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Enable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables the count-down timer with the specified */
;/* value. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Enable_Timer
_TMT_Enable_Timer:
;VOID TMT_Enable_Timer(UNSIGNED time)
;{
;
; /* Place the new time value into the count-down timer. */
; TMD_Timer = time;
;
MOVE.L D1,-(A7) ; Pickup the timer request value
MOVE.L 8(A7),D1
MOVE.L D1,_TMD_Timer
MOVE.L (A7)+,D1
;
; /* Indicate that the timer is active. */
; TMD_Timer_State = TM_ACTIVE;
;
CLR.L _TMD_Timer_State ; Activate the timer
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Adjust_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function adjusts the count-down timer with the specified */
;/* value- if the new value is less than the current. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Adjust_Timer
_TMT_Adjust_Timer:
;VOID TMT_Adjust_Timer(UNSIGNED time)
;{
;
; /* Lockout interrupts. */
;
MOVE.W SR,D0
ORI.L #LOCKOUT,D0
MOVE.W D0,SR
;
; /* See if new time value is less than current time value. */
; if (time < TMD_Timer)
;
MOVE.L 4(A7),D0 ; Pickup new value
CMP.L _TMD_Timer,D0 ; Compare it with current
BGE _TMT_No_Adjust ; If current is less, skip adjust
;
; /* Adjust timer. */
; TMD_Timer = time;
;
MOVE.L D0,_TMD_Timer ; Setup new timer value
;
_TMT_No_Adjust:
;
; /* Restore interrupt level. */
;
MOVE.W SR,D1 ; Pickup the SR
AND.L #$0000F8FF,D1
OR.L _TCD_Interrupt_Level,D1
MOVE.W D1,SR ; Put new level in SR
;
; /* Return to caller. */
;
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Disable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function disables the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Disable_Timer
_TMT_Disable_Timer:
;VOID TMT_Disable_Timer(void)
;{
;
; /* Disable the count-down timer. */
; TMD_Timer_State = TM_NOT_ACTIVE;
;
MOVE.L D1,-(A7) ; De-activate the timer
MOVE.L #1,D1
MOVE.L D1,_TMD_Timer_State
MOVE.L (A7)+,D1
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Retrieve_TS_Task */
;/* */
;/* DESCRIPTION */
;/* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -