📄 pollq.lst
字号:
130 }
131
132 /* Update the value we are going to post next time around. */
133 usValue++;
\ ??vPolledQueueProducer_3:
\ 00000024 6846 MOV R0,SP
\ 00000026 6946 MOV R1,SP
\ 00000028 0988 LDRH R1,[R1, #+0]
\ 0000002A 491C ADD R1,R1,#+0x1
\ 0000002C 0180 STRH R1,[R0, #+0]
134 }
\ ??vPolledQueueProducer_4:
\ 0000002E 7F1E SUB R7,R7,#+0x1
\ 00000030 03D1 BNE ??vPolledQueueProducer_5
135 }
136
137 /* Wait before we start posting again to ensure the consumer runs and
138 empties the queue. */
139 vTaskDelay( pollqDELAY );
\ 00000032 C820 MOV R0,#+0xC8
\ 00000034 ........ _BLF vTaskDelay,vTaskDelay??rT
\ ??vPolledQueueProducer_1:
\ 00000038 0327 MOV R7,#+0x3
\ ??vPolledQueueProducer_5:
\ 0000003A 0022 MOV R2,#+0
\ 0000003C 6946 MOV R1,SP
\ 0000003E 2068 LDR R0,[R4, #+0]
\ 00000040 ........ _BLF xQueueSend,xQueueSend??rT
\ 00000044 0128 CMP R0,#+0x1
\ 00000046 E3D0 BEQ ??vPolledQueueProducer_2
\ 00000048 0125 MOV R5,#+0x1
\ 0000004A F0E7 B ??vPolledQueueProducer_4
140 }
141 } /*lint !e818 Function prototype must conform to API. */
142 /*-----------------------------------------------------------*/
143
\ In segment CODE, align 4, keep-with-next
144 static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )
145 {
\ ??vPolledQueueConsumer:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 81B0 SUB SP,#+0x4
\ 00000004 041C MOV R4,R0
146 unsigned portSHORT usData, usExpectedValue = ( unsigned portSHORT ) 0;
\ 00000006 0025 MOV R5,#+0
147 signed portBASE_TYPE xError = pdFALSE;
\ 00000008 0026 MOV R6,#+0
\ 0000000A 02E0 B ??vPolledQueueConsumer_1
148
149 for( ;; )
150 {
151 /* Loop until the queue is empty. */
152 while( uxQueueMessagesWaiting( *( ( xQueueHandle * ) pvParameters ) ) )
153 {
154 if( xQueueReceive( *( ( xQueueHandle * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
155 {
156 if( usData != usExpectedValue )
157 {
158 /* This is not what we expected to receive so an error has
159 occurred. */
160 xError = pdTRUE;
161
162 /* Catch-up to the value we received so our next expected
163 value should again be correct. */
164 usExpectedValue = usData;
165 }
166 else
167 {
168 if( xError == pdFALSE )
169 {
170 /* Only increment the check variable if no errors have
171 occurred. */
172 portENTER_CRITICAL();
173 xPollingConsumerCount++;
174 portEXIT_CRITICAL();
175 }
176 }
177
178 /* Next time round we would expect the number to be one higher. */
179 usExpectedValue++;
180 }
181 }
182
183 /* Now the queue is empty we block, allowing the producer to place more
184 items in the queue. */
185 vTaskDelay( pollqDELAY );
\ ??vPolledQueueConsumer_2:
\ 0000000C C820 MOV R0,#+0xC8
\ 0000000E ........ _BLF vTaskDelay,vTaskDelay??rT
\ ??vPolledQueueConsumer_1:
\ 00000012 2068 LDR R0,[R4, #+0]
\ 00000014 ........ _BLF uxQueueMessagesWaiting,uxQueueMessagesWaiting??rT
\ 00000018 0028 CMP R0,#+0
\ 0000001A F7D0 BEQ ??vPolledQueueConsumer_2
\ 0000001C 0022 MOV R2,#+0
\ 0000001E 6946 MOV R1,SP
\ 00000020 2068 LDR R0,[R4, #+0]
\ 00000022 ........ _BLF xQueueReceive,xQueueReceive??rT
\ 00000026 0128 CMP R0,#+0x1
\ 00000028 F3D1 BNE ??vPolledQueueConsumer_1
\ 0000002A 6846 MOV R0,SP
\ 0000002C 0088 LDRH R0,[R0, #+0]
\ 0000002E 2D04 LSL R5,R5,#+0x10
\ 00000030 2D0C LSR R5,R5,#+0x10
\ 00000032 A842 CMP R0,R5
\ 00000034 03D0 BEQ ??vPolledQueueConsumer_3
\ 00000036 0126 MOV R6,#+0x1
\ 00000038 6846 MOV R0,SP
\ 0000003A 0588 LDRH R5,[R0, #+0]
\ 0000003C 09E0 B ??vPolledQueueConsumer_4
\ ??vPolledQueueConsumer_3:
\ 0000003E 002E CMP R6,#+0
\ 00000040 07D1 BNE ??vPolledQueueConsumer_4
\ 00000042 ........ _BLF vPortEnterCritical,vPortEnterCritical??rT
\ 00000046 .... LDR R0,??DataTable3 ;; ??xPollingConsumerCount
\ 00000048 0168 LDR R1,[R0, #+0]
\ 0000004A 491C ADD R1,R1,#+0x1
\ 0000004C 0160 STR R1,[R0, #+0]
\ 0000004E ........ _BLF vPortExitCritical,vPortExitCritical??rT
\ ??vPolledQueueConsumer_4:
\ 00000052 6D1C ADD R5,R5,#+0x1
\ 00000054 DDE7 B ??vPolledQueueConsumer_1
186 }
187 } /*lint !e818 Function prototype must conform to API. */
188 /*-----------------------------------------------------------*/
189
190 /* This is called to check that all the created tasks are still running with no errors. */
\ In segment CODE, align 4, keep-with-next
191 portBASE_TYPE xArePollingQueuesStillRunning( void )
192 {
193 portBASE_TYPE xReturn;
194
195 /* Check both the consumer and producer poll count to check they have both
196 been changed since out last trip round. We do not need a critical section
197 around the check variables as this is called from a higher priority than
198 the other tasks that access the same variables. */
199 if( ( xPollingConsumerCount == pollqINITIAL_VALUE ) ||
200 ( xPollingProducerCount == pollqINITIAL_VALUE )
201 )
\ xArePollingQueuesStillRunning:
\ 00000000 .... LDR R1,??DataTable2 ;; ??xPollingProducerCount
\ 00000002 0022 MOV R2,#+0
\ 00000004 .... LDR R3,??DataTable3 ;; ??xPollingConsumerCount
\ 00000006 1868 LDR R0,[R3, #+0]
\ 00000008 0028 CMP R0,#+0
\ 0000000A 02D0 BEQ ??xArePollingQueuesStillRunning_0
\ 0000000C 0868 LDR R0,[R1, #+0]
\ 0000000E 0028 CMP R0,#+0
\ 00000010 01D1 BNE ??xArePollingQueuesStillRunning_1
202 {
203 xReturn = pdFALSE;
\ ??xArePollingQueuesStillRunning_0:
\ 00000012 0020 MOV R0,#+0
\ 00000014 00E0 B ??xArePollingQueuesStillRunning_2
204 }
205 else
206 {
207 xReturn = pdTRUE;
\ ??xArePollingQueuesStillRunning_1:
\ 00000016 0120 MOV R0,#+0x1
208 }
209
210 /* Set the check variables back down so we know if they have been
211 incremented the next time around. */
212 xPollingConsumerCount = pollqINITIAL_VALUE;
\ ??xArePollingQueuesStillRunning_2:
\ 00000018 1A60 STR R2,[R3, #+0]
213 xPollingProducerCount = pollqINITIAL_VALUE;
\ 0000001A 0A60 STR R2,[R1, #+0]
214
215 return xReturn;
\ 0000001C 00B0 ADD SP,#+0
\ 0000001E 7047 BX LR ;; return
216 }
\ In segment CODE, align 4, keep-with-next
\ ??DataTable2:
\ 00000000 ........ DC32 ??xPollingProducerCount
\ In segment CODE, align 4, keep-with-next
\ ??DataTable3:
\ 00000000 ........ DC32 ??xPollingConsumerCount
\ In segment DATA_C, align 4, align-sorted
\ `?<Constant "QConsNB">`:
\ 00000000 51436F6E734E DC8 "QConsNB"
\ 4200
\ In segment DATA_C, align 4, align-sorted
\ `?<Constant "QProdNB">`:
\ 00000000 5150726F644E DC8 "QProdNB"
\ 4200
Maximum stack usage in bytes:
Function CSTACK
-------- ------
vPolledQueueConsumer 20
vPolledQueueProducer 24
vStartPolledQueueTasks 28
xArePollingQueuesStillRunning 4
Segment part sizes:
Function/Label Bytes
-------------- -----
xPollingConsumerCount 4
xPollingProducerCount 4
vStartPolledQueueTasks 80
xPolledQueue 4
vPolledQueueProducer 76
vPolledQueueConsumer 86
xArePollingQueuesStillRunning 32
??DataTable2 4
??DataTable3 4
?<Constant "QConsNB"> 8
?<Constant "QProdNB"> 8
Others 116
386 bytes in segment CODE
16 bytes in segment DATA_C
12 bytes in segment DATA_Z
12 bytes in segment INITTAB
282 bytes of CODE memory (+ 116 bytes shared)
16 bytes of CONST memory
12 bytes of DATA memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -