⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_time.lst

📁 AVR平台下的ucos版本
💻 LST
📖 第 1 页 / 共 2 页
字号:
   1               		.file	"os_time.c"
   2               		.arch atmega128
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  11               		.text
  12               	.Ltext0:
 131               	.global	OSTimeDly
 133               	OSTimeDly:
   1:os/source/os_time.c **** /*
   2:os/source/os_time.c **** ***************************************************************************************************
   3:os/source/os_time.c **** *                                                uC/OS-II
   4:os/source/os_time.c **** *                                          The Real-Time Kernel
   5:os/source/os_time.c **** *                                             TIME MANAGEMENT
   6:os/source/os_time.c **** *
   7:os/source/os_time.c **** *                          (c) Copyright 1992-2001, Jean J. Labrosse, Weston, FL
   8:os/source/os_time.c **** *                                           All Rights Reserved
   9:os/source/os_time.c **** *
  10:os/source/os_time.c **** * File : OS_TIME.C
  11:os/source/os_time.c **** * By   : Jean J. Labrosse
  12:os/source/os_time.c **** ***************************************************************************************************
  13:os/source/os_time.c **** */
  14:os/source/os_time.c **** 
  15:os/source/os_time.c **** #ifndef  OS_MASTER_FILE
  16:os/source/os_time.c **** #include <include.h>
  17:os/source/os_time.c **** #endif
  18:os/source/os_time.c **** 
  19:os/source/os_time.c **** /*
  20:os/source/os_time.c **** ***************************************************************************************************
  21:os/source/os_time.c **** *                                DELAY TASK 'n' TICKS   (n from 0 to 65535)
  22:os/source/os_time.c **** *
  23:os/source/os_time.c **** * Description: This function is called to delay execution of the currently running task until the
  24:os/source/os_time.c **** *              specified number of system ticks expires.  This, of course, directly equates to dela
  25:os/source/os_time.c **** *              the current task for some time to expire.  No delay will result If the specified del
  26:os/source/os_time.c **** *              0.  If the specified delay is greater than 0 then, a context switch will result.
  27:os/source/os_time.c **** *
  28:os/source/os_time.c **** * Arguments  : ticks     is the time delay that the task will be suspended in number of clock 'tick
  29:os/source/os_time.c **** *                        Note that by specifying 0, the task will not be delayed.
  30:os/source/os_time.c **** *
  31:os/source/os_time.c **** * Returns    : none
  32:os/source/os_time.c **** ***************************************************************************************************
  33:os/source/os_time.c **** */
  34:os/source/os_time.c **** 
  35:os/source/os_time.c **** void  OSTimeDly (INT16U ticks)
  36:os/source/os_time.c **** {
 135               	.LM1:
 136               	/* prologue: frame size=0 */
 137 0000 CF93      		push r28
 138 0002 DF93      		push r29
 139               	/* prologue end (size=2) */
 140 0004 9C01      		movw r18,r24
  37:os/source/os_time.c **** #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register       
  38:os/source/os_time.c ****     OS_CPU_SR  cpu_sr;
  39:os/source/os_time.c **** #endif    
  40:os/source/os_time.c **** 
  41:os/source/os_time.c **** 
  42:os/source/os_time.c ****     if (ticks > 0) {                                                      /* 0 means no delay!     
 142               	.LM2:
 143 0006 892B      		or r24,r25
 144 0008 F9F0      		breq .L1
  43:os/source/os_time.c ****         OS_ENTER_CRITICAL();
 146               	.LM3:
 147               	/* #APP */
 148 000a F894      		cli
  44:os/source/os_time.c ****         if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) {  /* Delay current task    
 150               	.LM4:
 151               	/* #NOAPP */
 152 000c A091 0000 		lds r26,OSTCBCur
 153 0010 B091 0000 		lds r27,(OSTCBCur)+1
 154 0014 ED01      		movw r28,r26
 155 0016 8B8D      		ldd r24,Y+27
 156 0018 E82F      		mov r30,r24
 157 001a FF27      		clr r31
 158 001c E050      		subi r30,lo8(-(OSRdyTbl))
 159 001e F040      		sbci r31,hi8(-(OSRdyTbl))
 160 0020 9C8D      		ldd r25,Y+28
 161 0022 9095      		com r25
 162 0024 8081      		ld r24,Z
 163 0026 8923      		and r24,r25
 164 0028 8083      		st Z,r24
 165 002a 8823      		tst r24
 166 002c 39F4      		brne .L3
  45:os/source/os_time.c ****             OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
 168               	.LM5:
 169 002e 9D8D      		ldd r25,Y+29
 170 0030 9095      		com r25
 171 0032 8091 0000 		lds r24,OSRdyGrp
 172 0036 8923      		and r24,r25
 173 0038 8093 0000 		sts OSRdyGrp,r24
 174               	.L3:
  46:os/source/os_time.c ****         }
  47:os/source/os_time.c ****         OSTCBCur->OSTCBDly = ticks;                                       /* Load ticks in TCB     
 176               	.LM6:
 177 003c FD01      		movw r30,r26
 178 003e 378B      		std Z+23,r19
 179 0040 268B      		std Z+22,r18
  48:os/source/os_time.c ****         OS_EXIT_CRITICAL();
 181               	.LM7:
 182               	/* #APP */
 183 0042 7894      		sei
  49:os/source/os_time.c ****         OS_Sched();                                                       /* Find next task to run!
 185               	.LM8:
 186               	/* #NOAPP */
 187 0044 0E94 0000 		call OS_Sched
 188               	.L1:
 189               	/* epilogue: frame size=0 */
 190 0048 DF91      		pop r29
 191 004a CF91      		pop r28
 192 004c 0895      		ret
 193               	/* epilogue end (size=3) */
 194               	/* function OSTimeDly size 41 (36) */
 196               	.Lscope0:
 202               	.global	OSTimeDlyHMSM
 204               	OSTimeDlyHMSM:
  50:os/source/os_time.c ****     }
  51:os/source/os_time.c **** }
  52:os/source/os_time.c **** /*$PAGE*/
  53:os/source/os_time.c **** /*
  54:os/source/os_time.c **** ***************************************************************************************************
  55:os/source/os_time.c **** *                                     DELAY TASK FOR SPECIFIED TIME
  56:os/source/os_time.c **** *
  57:os/source/os_time.c **** * Description: This function is called to delay execution of the currently running task until some 
  58:os/source/os_time.c **** *              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS 
  59:os/source/os_time.c **** *              MILLISECONDS instead of ticks.
  60:os/source/os_time.c **** *
  61:os/source/os_time.c **** * Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
  62:os/source/os_time.c **** *              minutes   specifies the number of minutes (max. 59)
  63:os/source/os_time.c **** *              seconds   specifies the number of seconds (max. 59)
  64:os/source/os_time.c **** *              milli     specifies the number of milliseconds (max. 999)
  65:os/source/os_time.c **** *
  66:os/source/os_time.c **** * Returns    : OS_NO_ERR
  67:os/source/os_time.c **** *              OS_TIME_INVALID_MINUTES
  68:os/source/os_time.c **** *              OS_TIME_INVALID_SECONDS
  69:os/source/os_time.c **** *              OS_TIME_INVALID_MS
  70:os/source/os_time.c **** *              OS_TIME_ZERO_DLY
  71:os/source/os_time.c **** *
  72:os/source/os_time.c **** * Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't
  73:os/source/os_time.c **** *              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would 
  74:os/source/os_time.c **** *              set to 0.  The actual delay is rounded to the nearest tick.
  75:os/source/os_time.c **** ***************************************************************************************************
  76:os/source/os_time.c **** */
  77:os/source/os_time.c **** 
  78:os/source/os_time.c **** #if OS_TIME_DLY_HMSM_EN > 0
  79:os/source/os_time.c **** INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
  80:os/source/os_time.c **** {
 206               	.LM9:
 207               	/* prologue: frame size=0 */
 208 004e AF92      		push r10
 209 0050 BF92      		push r11
 210 0052 CF92      		push r12
 211 0054 DF92      		push r13
 212 0056 EF92      		push r14
 213 0058 FF92      		push r15
 214 005a 0F93      		push r16
 215 005c 1F93      		push r17
 216 005e CF93      		push r28
 217 0060 DF93      		push r29
 218               	/* prologue end (size=10) */
 219 0062 A62E      		mov r10,r22
 220 0064 D42E      		mov r13,r20
 221 0066 E901      		movw r28,r18
  81:os/source/os_time.c ****     INT32U ticks;
  82:os/source/os_time.c ****     INT16U loops;
  83:os/source/os_time.c **** 
  84:os/source/os_time.c **** 
  85:os/source/os_time.c ****     if (hours > 0 || minutes > 0 || seconds > 0 || milli > 0) {
 223               	.LM10:
 224 0068 8823      		tst r24
 225 006a 41F4      		brne .L6
 227               	.LM11:
 228 006c 6623      		tst r22
 229 006e 31F4      		brne .L6
 230 0070 4423      		tst r20
 231 0072 51F4      		brne .L7
 232 0074 232B      		or r18,r19
 233 0076 09F4      		brne .+2
 234 0078 78C0      		rjmp .L5
 235 007a 06C0      		rjmp .L7
 236               	.L6:
  86:os/source/os_time.c ****         if (minutes > 59) {
 238               	.LM12:
 239 007c 9BE3      		ldi r25,lo8(59)
 240 007e 9A15      		cp r25,r10
 241 0080 18F4      		brsh .L7
  87:os/source/os_time.c ****             return (OS_TIME_INVALID_MINUTES);    /* Validate arguments to be within range          
 243               	.LM13:
 244 0082 81E5      		ldi r24,lo8(81)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -