os_time.lst

来自「atmega单片机用的ucos系统 占用内存适中 是atmega单片机合适的操作」· LST 代码 · 共 400 行 · 第 1/2 页

LST
400
字号
   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:
  85               	.global	OSTimeDly
  87               	OSTimeDly:
   1:OSsrc/os_time.c **** /*
   2:OSsrc/os_time.c **** ***************************************************************************************************
   3:OSsrc/os_time.c **** *                                                uC/OS-II
   4:OSsrc/os_time.c **** *                                          The Real-Time Kernel
   5:OSsrc/os_time.c **** *                                             TIME MANAGEMENT
   6:OSsrc/os_time.c **** *
   7:OSsrc/os_time.c **** *                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
   8:OSsrc/os_time.c **** *                                           All Rights Reserved
   9:OSsrc/os_time.c **** *
  10:OSsrc/os_time.c **** * File    : OS_TIME.C
  11:OSsrc/os_time.c **** * By      : Jean J. Labrosse
  12:OSsrc/os_time.c **** * Version : V2.76
  13:OSsrc/os_time.c **** ***************************************************************************************************
  14:OSsrc/os_time.c **** */
  15:OSsrc/os_time.c **** 
  16:OSsrc/os_time.c **** #ifndef  OS_MASTER_FILE
  17:OSsrc/os_time.c **** #include "ucos_ii.h"
  18:OSsrc/os_time.c **** #endif
  19:OSsrc/os_time.c **** 
  20:OSsrc/os_time.c **** /*
  21:OSsrc/os_time.c **** ***************************************************************************************************
  22:OSsrc/os_time.c **** *                                DELAY TASK 'n' TICKS   (n from 0 to 65535)
  23:OSsrc/os_time.c **** *
  24:OSsrc/os_time.c **** * Description: This function is called to delay execution of the currently running task until the
  25:OSsrc/os_time.c **** *              specified number of system ticks expires.  This, of course, directly equates to dela
  26:OSsrc/os_time.c **** *              the current task for some time to expire.  No delay will result If the specified del
  27:OSsrc/os_time.c **** *              0.  If the specified delay is greater than 0 then, a context switch will result.
  28:OSsrc/os_time.c **** *
  29:OSsrc/os_time.c **** * Arguments  : ticks     is the time delay that the task will be suspended in number of clock 'tick
  30:OSsrc/os_time.c **** *                        Note that by specifying 0, the task will not be delayed.
  31:OSsrc/os_time.c **** *
  32:OSsrc/os_time.c **** * Returns    : none
  33:OSsrc/os_time.c **** ***************************************************************************************************
  34:OSsrc/os_time.c **** */
  35:OSsrc/os_time.c **** 
  36:OSsrc/os_time.c **** void  OSTimeDly (INT16U ticks)
  37:OSsrc/os_time.c **** {
  89               	.LM1:
  90               	/* prologue: frame size=0 */
  91 0000 CF93      		push r28
  92 0002 DF93      		push r29
  93               	/* prologue end (size=2) */
  94 0004 9C01      		movw r18,r24
  38:OSsrc/os_time.c ****     INT8U      y;
  39:OSsrc/os_time.c **** #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register       
  40:OSsrc/os_time.c ****     OS_CPU_SR  cpu_sr;
  41:OSsrc/os_time.c **** 
  42:OSsrc/os_time.c **** 
  43:OSsrc/os_time.c **** 
  44:OSsrc/os_time.c ****     cpu_sr = 0;                                  /* Prevent compiler warning                       
  45:OSsrc/os_time.c **** #endif    
  46:OSsrc/os_time.c ****     if (ticks > 0) {                             /* 0 means no delay!                              
  96               	.LM2:
  97 0006 892B      		or r24,r25
  98 0008 11F1      		breq .L1
  47:OSsrc/os_time.c ****         OS_ENTER_CRITICAL();
 100               	.LM3:
 101               	/* #APP */
 102 000a 0FB6      		in __tmp_reg__,__SREG__
 103 000c F894      		cli
 104 000e 0F92      		push __tmp_reg__
  48:OSsrc/os_time.c ****         y            =  OSTCBCur->OSTCBY;        /* Delay current task                             
 106               	.LM4:
 107               	/* #NOAPP */
 108 0010 A091 0000 		lds r26,OSTCBCur
 109 0014 B091 0000 		lds r27,(OSTCBCur)+1
 110 0018 ED01      		movw r28,r26
 111 001a 8889      		ldd r24,Y+16
  49:OSsrc/os_time.c ****         OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
 113               	.LM5:
 114 001c E82F      		mov r30,r24
 115 001e FF27      		clr r31
 116 0020 E050      		subi r30,lo8(-(OSRdyTbl))
 117 0022 F040      		sbci r31,hi8(-(OSRdyTbl))
 118 0024 9989      		ldd r25,Y+17
 119 0026 9095      		com r25
 120 0028 8081      		ld r24,Z
 121 002a 8923      		and r24,r25
 122 002c 8083      		st Z,r24
  50:OSsrc/os_time.c ****         if (OSRdyTbl[y] == 0) {  
 124               	.LM6:
 125 002e 8823      		tst r24
 126 0030 39F4      		brne .L3
  51:OSsrc/os_time.c ****             OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
 128               	.LM7:
 129 0032 9A89      		ldd r25,Y+18
 130 0034 9095      		com r25
 131 0036 8091 0000 		lds r24,OSRdyGrp
 132 003a 8923      		and r24,r25
 133 003c 8093 0000 		sts OSRdyGrp,r24
 134               	.L3:
  52:OSsrc/os_time.c ****         }
  53:OSsrc/os_time.c ****         OSTCBCur->OSTCBDly = ticks;              /* Load ticks in TCB                              
 136               	.LM8:
 137 0040 FD01      		movw r30,r26
 138 0042 2287      		std Z+10,r18
 139 0044 3387      		std Z+11,r19
  54:OSsrc/os_time.c ****         OS_EXIT_CRITICAL();
 141               	.LM9:
 142               	/* #APP */
 143 0046 0F90      		pop __tmp_reg__
 144 0048 0FBE      		out __SREG__,__tmp_reg__
  55:OSsrc/os_time.c ****         OS_Sched();                              /* Find next task to run!                         
 146               	.LM10:
 147               	/* #NOAPP */
 148 004a 0E94 0000 		call OS_Sched
 149               	.L1:
 150               	/* epilogue: frame size=0 */
 151 004e DF91      		pop r29
 152 0050 CF91      		pop r28
 153 0052 0895      		ret
 154               	/* epilogue end (size=3) */
 155               	/* function OSTimeDly size 47 (42) */
 160               	.Lscope0:
 166               	.global	OSTimeDlyHMSM
 168               	OSTimeDlyHMSM:
  56:OSsrc/os_time.c ****     }
  57:OSsrc/os_time.c **** }
  58:OSsrc/os_time.c **** /*$PAGE*/
  59:OSsrc/os_time.c **** /*
  60:OSsrc/os_time.c **** ***************************************************************************************************
  61:OSsrc/os_time.c **** *                                     DELAY TASK FOR SPECIFIED TIME
  62:OSsrc/os_time.c **** *
  63:OSsrc/os_time.c **** * Description: This function is called to delay execution of the currently running task until some 
  64:OSsrc/os_time.c **** *              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS 
  65:OSsrc/os_time.c **** *              MILLISECONDS instead of ticks.
  66:OSsrc/os_time.c **** *
  67:OSsrc/os_time.c **** * Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
  68:OSsrc/os_time.c **** *              minutes   specifies the number of minutes (max. 59)
  69:OSsrc/os_time.c **** *              seconds   specifies the number of seconds (max. 59)
  70:OSsrc/os_time.c **** *              milli     specifies the number of milliseconds (max. 999)
  71:OSsrc/os_time.c **** *
  72:OSsrc/os_time.c **** * Returns    : OS_NO_ERR
  73:OSsrc/os_time.c **** *              OS_TIME_INVALID_MINUTES
  74:OSsrc/os_time.c **** *              OS_TIME_INVALID_SECONDS
  75:OSsrc/os_time.c **** *              OS_TIME_INVALID_MS
  76:OSsrc/os_time.c **** *              OS_TIME_ZERO_DLY
  77:OSsrc/os_time.c **** *
  78:OSsrc/os_time.c **** * Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't
  79:OSsrc/os_time.c **** *              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would 
  80:OSsrc/os_time.c **** *              set to 0.  The actual delay is rounded to the nearest tick.
  81:OSsrc/os_time.c **** ***************************************************************************************************
  82:OSsrc/os_time.c **** */
  83:OSsrc/os_time.c **** 
  84:OSsrc/os_time.c **** #if OS_TIME_DLY_HMSM_EN > 0
  85:OSsrc/os_time.c **** INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
  86:OSsrc/os_time.c **** {
 170               	.LM11:
 171               	/* prologue: frame size=0 */
 172 0054 AF92      		push r10
 173 0056 BF92      		push r11
 174 0058 CF92      		push r12
 175 005a DF92      		push r13
 176 005c EF92      		push r14
 177 005e FF92      		push r15
 178 0060 0F93      		push r16
 179 0062 1F93      		push r17
 180 0064 CF93      		push r28
 181 0066 DF93      		push r29
 182               	/* prologue end (size=10) */
 183 0068 A62E      		mov r10,r22
 184 006a D42E      		mov r13,r20
 185 006c E901      		movw r28,r18
  87:OSsrc/os_time.c ****     INT32U ticks;
  88:OSsrc/os_time.c ****     INT16U loops;
  89:OSsrc/os_time.c **** 
  90:OSsrc/os_time.c **** 
  91:OSsrc/os_time.c **** #if OS_ARG_CHK_EN > 0
  92:OSsrc/os_time.c ****     if (hours == 0) {
 187               	.LM12:
 188 006e 8823      		tst r24
 189 0070 49F4      		brne .L5
  93:OSsrc/os_time.c ****         if (minutes == 0) {
 191               	.LM13:
 192 0072 6623      		tst r22
 193 0074 39F4      		brne .L5
  94:OSsrc/os_time.c ****             if (seconds == 0) {
 195               	.LM14:
 196 0076 4423      		tst r20
 197 0078 59F4      		brne .L9
  95:OSsrc/os_time.c ****                 if (milli == 0) {
 199               	.LM15:
 200 007a 232B      		or r18,r19
 201 007c 79F4      		brne .L10
  96:OSsrc/os_time.c ****                     return (OS_TIME_ZERO_DLY);
 203               	.LM16:
 204 007e 84E5      		ldi r24,lo8(84)

⌨️ 快捷键说明

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