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

📄 queue.lst

📁 本代码已经经过修改
💻 LST
📖 第 1 页 / 共 5 页
字号:
    318          			taskEXIT_CRITICAL();
   \   00000076   ........           _BLF        vPortExitCritical,vPortExitCritical??rT
    319          		}
    320          	}
    321          		
    322          	/* When we are here it is possible that we unblocked as space became 
    323          	available on the queue.  It is also possible that an ISR posted to the
    324          	queue since we left the critical section, so it may be that again there
    325          	is no space.  This would only happen if a task and ISR post onto the
    326          	same queue. */
    327          	taskENTER_CRITICAL();
   \                     ??xQueueSend_2:
   \   0000007A   ........           _BLF        vPortEnterCritical,vPortEnterCritical??rT
    328          	{
    329          		if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
   \   0000007E   206D               LDR         R0,[R4, #+0x50]
   \   00000080   616D               LDR         R1,[R4, #+0x54]
   \   00000082   8842               CMP         R0,R1
   \   00000084   17D2               BCS         ??xQueueSend_4
    330          		{
    331          			/* There is room in the queue, copy the data into the queue. */			
    332          			prvCopyQueueData( pxQueue, pvItemToQueue );		
   \   00000086   A06D               LDR         R0,[R4, #+0x58]
   \   00000088   A168               LDR         R1,[R4, #+0x8]
   \   0000008A   0028               CMP         R0,#+0
   \   0000008C   03D0               BEQ         ??xQueueSend_5
   \                     ??xQueueSend_6:
   \   0000008E   401E               SUB         R0,R0,#+0x1
   \   00000090   325C               LDRB        R2,[R6, R0]
   \   00000092   0A54               STRB        R2,[R1, R0]
   \   00000094   FBD1               BNE         ??xQueueSend_6
   \                     ??xQueueSend_5:
   \   00000096   206D               LDR         R0,[R4, #+0x50]
   \   00000098   401C               ADD         R0,R0,#+0x1
   \   0000009A   2065               STR         R0,[R4, #+0x50]
   \   0000009C   A06D               LDR         R0,[R4, #+0x58]
   \   0000009E   A168               LDR         R1,[R4, #+0x8]
   \   000000A0   0818               ADD         R0,R1,R0
   \   000000A2   A060               STR         R0,[R4, #+0x8]
   \   000000A4   6168               LDR         R1,[R4, #+0x4]
   \   000000A6   8842               CMP         R0,R1
   \   000000A8   01D3               BCC         ??xQueueSend_7
   \   000000AA   2068               LDR         R0,[R4, #+0]
   \   000000AC   A060               STR         R0,[R4, #+0x8]
    333          			xReturn = pdPASS;
    334          
    335          			/* Update the TxLock count so prvUnlockQueue knows to check for
    336          			tasks waiting for data to become available in the queue. */
    337          			++( pxQueue->xTxLock );
   \                     ??xQueueSend_7:
   \   000000AE   206E               LDR         R0,[R4, #+0x60]
   \   000000B0   401C               ADD         R0,R0,#+0x1
   \   000000B2   2066               STR         R0,[R4, #+0x60]
   \   000000B4   01E0               B           ??xQueueSend_8
    338          		}
    339          		else
    340          		{
    341          			xReturn = errQUEUE_FULL;
   \                     ??xQueueSend_4:
   \   000000B6   0225               MOV         R5,#+0x2
   \   000000B8   ED43               MVN         R5,R5              ;; #-3
    342          		}
    343          	}
    344          	taskEXIT_CRITICAL();
   \                     ??xQueueSend_8:
   \   000000BA   ........           _BLF        vPortExitCritical,vPortExitCritical??rT
    345          
    346          	/* We no longer require exclusive access to the queue.  prvUnlockQueue
    347          	will remove any tasks suspended on a receive if either this function 
    348          	or an ISR has posted onto the queue. */
    349          	if( prvUnlockQueue( pxQueue ) )
   \   000000BE   201C               MOV         R0,R4
   \   000000C0   ........           BL          ??prvUnlockQueue
   \   000000C4   0028               CMP         R0,#+0
   \   000000C6   05D0               BEQ         ??xQueueSend_9
    350          	{
    351          		/* Resume the scheduler - making ready any tasks that were woken
    352          		by an event while the scheduler was locked.  Resuming the 
    353          		scheduler may cause a yield, in which case there is no point
    354          		yielding again here. */
    355          		if( !xTaskResumeAll() )
   \   000000C8   ........           _BLF        xTaskResumeAll,xTaskResumeAll??rT
   \   000000CC   0028               CMP         R0,#+0
   \   000000CE   03D1               BNE         ??xQueueSend_10
    356          		{
    357          			taskYIELD();
   \   000000D0   00DF               SWI 0          
   \   000000D2   01E0               B           ??xQueueSend_10
    358          		}
    359          	}
    360          	else
    361          	{
    362          		/* Resume the scheduler - making ready any tasks that were woken
    363          		by an event while the scheduler was locked. */
    364          		xTaskResumeAll();
   \                     ??xQueueSend_9:
   \   000000D4   ........           _BLF        xTaskResumeAll,xTaskResumeAll??rT
    365          	}
    366          
    367          	return xReturn;
   \                     ??xQueueSend_10:
   \   000000D8   281C               MOV         R0,R5
   \   000000DA   01B0               ADD         SP,#+0x4
   \   000000DC   F0BC               POP         {R4-R7}
   \   000000DE   02BC               POP         {R1}
   \   000000E0   0847               BX          R1                 ;; return
    368          }
    369          /*-----------------------------------------------------------*/
    370          

   \                                 In segment CODE, align 4, keep-with-next
    371          signed portBASE_TYPE xQueueSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken )
    372          {
   \                     xQueueSendFromISR:
   \   00000000   30B5               PUSH        {R4,R5,LR}
   \   00000002   141C               MOV         R4,R2
    373          	/* Similar to xQueueSend, except we don't block if there is no room in the
    374          	queue.  Also we don't directly wake a task that was blocked on a queue
    375          	read, instead we return a flag to say whether a context switch is required
    376          	or not (i.e. has a task with a higher priority than us been woken by this
    377          	post). */
    378          	if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
   \   00000004   026D               LDR         R2,[R0, #+0x50]
   \   00000006   436D               LDR         R3,[R0, #+0x54]
   \   00000008   9A42               CMP         R2,R3
   \   0000000A   26D2               BCS         ??xQueueSendFromISR_0
    379          	{
    380          		prvCopyQueueData( pxQueue, pvItemToQueue );
   \   0000000C   826D               LDR         R2,[R0, #+0x58]
   \   0000000E   8368               LDR         R3,[R0, #+0x8]
   \   00000010   002A               CMP         R2,#+0
   \   00000012   03D0               BEQ         ??xQueueSendFromISR_1
   \                     ??xQueueSendFromISR_2:
   \   00000014   521E               SUB         R2,R2,#+0x1
   \   00000016   8D5C               LDRB        R5,[R1, R2]
   \   00000018   9D54               STRB        R5,[R3, R2]
   \   0000001A   FBD1               BNE         ??xQueueSendFromISR_2
   \                     ??xQueueSendFromISR_1:
   \   0000001C   016D               LDR         R1,[R0, #+0x50]
   \   0000001E   491C               ADD         R1,R1,#+0x1
   \   00000020   0165               STR         R1,[R0, #+0x50]
   \   00000022   816D               LDR         R1,[R0, #+0x58]
   \   00000024   8268               LDR         R2,[R0, #+0x8]
   \   00000026   5118               ADD         R1,R2,R1
   \   00000028   8160               STR         R1,[R0, #+0x8]
   \   0000002A   4268               LDR         R2,[R0, #+0x4]
   \   0000002C   9142               CMP         R1,R2
   \   0000002E   01D3               BCC         ??xQueueSendFromISR_3
   \   00000030   0168               LDR         R1,[R0, #+0]
   \   00000032   8160               STR         R1,[R0, #+0x8]
    381          
    382          		/* If the queue is locked we do not alter the event list.  This will
    383          		be done when the queue is unlocked later. */
    384          		if( pxQueue->xTxLock == queueUNLOCKED )
   \                     ??xQueueSendFromISR_3:
   \   00000034   016E               LDR         R1,[R0, #+0x60]
   \   00000036   0022               MOV         R2,#+0
   \   00000038   D243               MVN         R2,R2              ;; #-1
   \   0000003A   9142               CMP         R1,R2
   \   0000003C   0BD1               BNE         ??xQueueSendFromISR_4
    385          		{
    386          			/* We only want to wake one task per ISR, so check that a task has
    387          			not already been woken. */
    388          			if( !xTaskPreviouslyWoken )		
   \   0000003E   002C               CMP         R4,#+0
   \   00000040   0BD1               BNE         ??xQueueSendFromISR_0
    389          			{
    390          				if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
   \   00000042   016B               LDR         R1,[R0, #+0x30]
   \   00000044   0029               CMP         R1,#+0
   \   00000046   08D0               BEQ         ??xQueueSendFromISR_0
    391          				{
    392          					if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
   \   00000048   3030               ADD         R0,#+0x30
   \   0000004A   ........           _BLF        xTaskRemoveFromEventList,xTaskRemoveFromEventList??rT
   \   0000004E   0028               CMP         R0,#+0
   \   00000050   03D0               BEQ         ??xQueueSendFromISR_0
    393          					{
    394          						/* The task waiting has a higher priority so record that a 
    395          						context	switch is required. */
    396          						return pdTRUE;
   \   00000052   0120               MOV         R0,#+0x1
   \   00000054   02E0               B           ??xQueueSendFromISR_5
    397          					}
    398          				}
    399          			}
    400          		}
    401          		else
    402          		{
    403          			/* Increment the lock count so the task that unlocks the queue 
    404          			knows that data was posted while it was locked. */
    405          			++( pxQueue->xTxLock );
   \                     ??xQueueSendFromISR_4:
   \   00000056   491C               ADD         R1,R1,#+0x1
   \   00000058   0166               STR         R1,[R0, #+0x60]
    406          		}
    407          	}
    408          
    409          	return xTaskPreviouslyWoken;
   \                     ??xQueueSendFromISR_0:
   \   0000005A   201C               MOV         R0,R4
   \                     ??xQueueSendFromISR_5:
   \   0000005C   30BC               POP         {R4,R5}
   \   0000005E   02BC               POP         {R1}
   \   00000060   0847               BX          R1                 ;; return
    410          }
    411          /*-----------------------------------------------------------*/
    412          

   \                                 In segment CODE, align 4, keep-with-next
    413          signed portBASE_TYPE xQueueReceive( xQueueHandle pxQueue, void *pcBuffer, portTickType xTicksToWait )
    414          {
   \                     xQueueReceive:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   041C               MOV         R4,R0
   \   00000004   0D1C               MOV         R5,R1
   \   00000006   161C               MOV         R6,R2
    415          signed portBASE_TYPE xReturn;
    416          
    417          	/* This function is very similar to xQueueSend().  See comments within
    418          	xQueueSend() for a more detailed explanation.
    419          
    420          	Make sure other tasks do not access the queue. */
    421          	vTaskSuspendAll();
   \   00000008   ........           _BLF        vTaskSuspendAll,vTaskSuspendAll??rT
    422          
    423          	/* Make sure interrupts do not access the queue. */
    424          	prvLockQueue( pxQueue );
   \   0000000C   ........           _BLF        vPortEnterCritical,vPortEnterCritical??rT
   \   00000010   E06D               LDR         R0,[R4, #+0x5C]

⌨️ 快捷键说明

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