📄 tmt.s
字号:
;/* OUTPUTS */
;/* */
;/* TMD_System_Clock Value of system clock */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* */
;/*************************************************************************/
;UNSIGNED TMT_Retrieve_Clock(void)
;{
EXPORT TMT_Retrieve_Clock
TMT_Retrieve_Clock
;
; /* Return the current value of the system clock. */
; return(TMD_System_Clock);
;
LDR a1,[pc, #System_Clock-.-8] ; Build address to system clock
LDR a1,[a1,#0] ; Pickup system clock contents
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; Return to caller
]
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Read_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_Timer Value of count-down timer */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* */
;/*************************************************************************/
;UNSIGNED TMT_Read_Timer(void)
;{
EXPORT TMT_Read_Timer
TMT_Read_Timer
;
; /* Return the current value of the count-down timer. */
; return(TMD_Timer);
;
LDR a1,[pc, #Timer-.-8] ; Build address to timer
LDR a1,[a1,#0] ; Pickup timer contents
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; Return to caller
]
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Enable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables the count-down timer with the specified */
;/* value. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, 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 */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* */
;/*************************************************************************/
;VOID TMT_Enable_Timer(UNSIGNED time)
;{
EXPORT TMT_Enable_Timer
TMT_Enable_Timer
;
; /* Place the new time value into the count-down timer. */
; TMD_Timer = time;
;
LDR a2,[pc, #Timer-.-8] ; Build address of timer
STR a1,[a2,#0] ; Store new timer value
;
; /* Indicate that the timer is active. */
; TMD_Timer_State = TM_ACTIVE;
;
MOV a1,#0 ; Build TM_ACTIVE value
LDR a2,[pc, #Timer_State-.-8] ; Build address of timer state var
STR a1,[a2,#0] ; Change the state to active
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; 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 */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* None */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time. */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* C. Meredith 03-01-1994 Created initial version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* C. Meredith 08-27-1994 Corrected bug in new timer */
;/* adjust routine, resulting in */
;/* version 1.1a */
;/* W. Lamie 08-27-1994 Verified version 1.1a */
;/* */
;/*************************************************************************/
;VOID TMT_Adjust_Timer(UNSIGNED time)
;{
EXPORT TMT_Adjust_Timer
TMT_Adjust_Timer
;
; /* Lockout all interrupts */
; TMD_Timer_State = TM_NOT_ACTIVE;
;
MRS a3,CPSR ; Pickup current CPSR
ORR a3,a3,#LOCKOUT ; Build lockout CPSR
MSR CPSR_cxsf,a3 ; Setup new CPSR interrupt bits
;
; /* check for the new value is less than the current time value */
; if (time < TMD_Timer)
;
LDR a2,[pc, #Timer-.-8] ; Build address to timer var
LDR a3,[a2,#0] ; read value of the timer
CMP a3,a1 ; Do Timer - time > 0, means
BLT TMT_No_Adjust ; time < Timer.
;
; /* adjust the time */
; TMD_Timer = time;
;
STR a1,[a2,#0] ; load passed in timer value
;
; return to caller after restoring interrupts
;
TMT_No_Adjust
LDR a2,[pc, #Int_Level-.-8] ; Build address to interrupt level
LDR a2,[a2,#0] ; read the interrupt level
MRS a3,CPSR ; Pickup current CPSR
BIC a3,a3,#LOCK_MSK ; Clear lockout mask
ORR a3,a3,a2 ; Build new CPSR with appropriate
; interrupts enabled
MSR CPSR_cxsf,a3 ; Setup new CPSR enable bits
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; Return to caller
]
;}
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Disable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function disables the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -