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

📄 blockq.s43

📁 MSP430 IAR project with FreeRTOS port.
💻 S43
📖 第 1 页 / 共 3 页
字号:
        CMP.W   #0x1, R12
        JEQ     ??vBlockingQueueProducer_1
//  191 		{
//  192 			sErrorEverOccurred = pdTRUE;
        MOV.W   #0x1, R8
        JMP     ??vBlockingQueueProducer_0
//  193 		}
//  194 		else
//  195 		{
//  196 			/* We have successfully posted a message, so increment the variable
//  197 			used to check we are still running. */
//  198 			if( sErrorEverOccurred == pdFALSE )
??vBlockingQueueProducer_1:
        CMP.W   #0x0, R8
        JNE     ??vBlockingQueueProducer_2
//  199 			{
//  200 				( *pxQueueParameters->psCheckVariable )++;
        MOV.W   0x4(R11), R15
        ADD.W   #0x1, 0(R15)
//  201 			}
//  202 
//  203 			/* Increment the variable we are going to post next time round.  The
//  204 			consumer will expect the numbers to	follow in numerical order. */
//  205 			++usValue;
??vBlockingQueueProducer_2:
        ADD.W   #0x1, 0x0(SP)
        JMP     ??vBlockingQueueProducer_0
        CFI EndBlock cfiBlock1
//  206 		}
//  207 	}
//  208 }
//  209 /*-----------------------------------------------------------*/
//  210 

        RSEG CODE:CODE:REORDER:NOROOT(1)
//  211 static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )
vBlockingQueueConsumer:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function vBlockingQueueConsumer
//  212 {
        FUNCALL vBlockingQueueConsumer, xQueueReceive
        LOCFRAME CSTACK, 14, STACK
        PUSH.W  R10
        CFI R10 Frame(CFA, -4)
        CFI CFA SP+4
        PUSH.W  R11
        CFI R11 Frame(CFA, -6)
        CFI CFA SP+6
        PUSH.W  R8
        CFI R8 Frame(CFA, -8)
        CFI CFA SP+8
        PUSH.W  R9
        CFI R9 Frame(CFA, -10)
        CFI CFA SP+10
        SUB.W   #0x2, SP
        CFI CFA SP+12
        MOV.W   R12, R10
//  213 unsigned portSHORT usData, usExpectedValue = 0;
        MOV.W   #0x0, R11
//  214 xBlockingQueueParameters *pxQueueParameters;
//  215 portSHORT sErrorEverOccurred = pdFALSE;
        MOV.W   #0x0, R9
//  216 
//  217 	pxQueueParameters = ( xBlockingQueueParameters * ) pvParameters;
        MOV.W   R10, R8
//  218 
//  219 	for( ;; )
//  220 	{	
//  221 		if( xQueueReceive( pxQueueParameters->xQueue, &usData, pxQueueParameters->xBlockTime ) == pdPASS )
??vBlockingQueueConsumer_0:
        PUSH.W  0x2(R8)
        CFI CFA SP+14
        MOV.W   SP, R14
        ADD.W   #0x2, R14
        MOV.W   @R8, R12
        CALL    #xQueueReceive
        ADD.W   #0x2, SP
        CFI CFA SP+12
        CMP.W   #0x1, R12
        JNE     ??vBlockingQueueConsumer_0
//  222 		{
//  223 			if( usData != usExpectedValue )
        CMP.W   R11, 0x0(SP)
        JEQ     ??vBlockingQueueConsumer_1
//  224 			{
//  225 				/* Catch-up. */
//  226 				usExpectedValue = usData;
        MOV.W   0x0(SP), R11
//  227 
//  228 				sErrorEverOccurred = pdTRUE;
        MOV.W   #0x1, R9
        JMP     ??vBlockingQueueConsumer_0
//  229 			}
//  230 			else
//  231 			{
//  232 				/* We have successfully received a message, so increment the
//  233 				variable used to check we are still running. */	
//  234 				if( sErrorEverOccurred == pdFALSE )
??vBlockingQueueConsumer_1:
        CMP.W   #0x0, R9
        JNE     ??vBlockingQueueConsumer_2
//  235 				{
//  236 					( *pxQueueParameters->psCheckVariable )++;
        MOV.W   0x4(R8), R15
        ADD.W   #0x1, 0(R15)
//  237 				}
//  238 							
//  239 				/* Increment the value we expect to remove from the queue next time
//  240 				round. */
//  241 				++usExpectedValue;
??vBlockingQueueConsumer_2:
        ADD.W   #0x1, R11
        JMP     ??vBlockingQueueConsumer_0
        CFI EndBlock cfiBlock2
//  242 			}			
//  243 		}		
//  244 	}
//  245 }
//  246 /*-----------------------------------------------------------*/
//  247 
//  248 /* This is called to check that all the created tasks are still running. */

        RSEG CODE:CODE:REORDER:NOROOT(1)
//  249 portBASE_TYPE xAreBlockingQueuesStillRunning( void )
xAreBlockingQueuesStillRunning:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI Function xAreBlockingQueuesStillRunning
//  250 {
        PUSH.W  R10
        CFI R10 Frame(CFA, -4)
        CFI CFA SP+4
//  251 static portSHORT sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
//  252 static portSHORT sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
//  253 portBASE_TYPE xReturn = pdPASS, xTasks;
        MOV.W   #0x1, R12
//  254 
//  255 	/* Not too worried about mutual exclusion on these variables as they are 16
//  256 	bits and we are only reading them. We also only care to see if they have
//  257 	changed or not.
//  258 	
//  259 	Loop through each check variable to and return pdFALSE if any are found not
//  260 	to have changed since the last call. */
//  261 
//  262 	for( xTasks = 0; xTasks < blckqNUM_TASK_SETS; xTasks++ )
        MOV.W   #0x0, R14
??xAreBlockingQueuesStillRunning_0:
        CMP.W   #0x3, R14
        JGE     ??xAreBlockingQueuesStillRunning_1
//  263 	{
//  264 		if( sBlockingConsumerCount[ xTasks ] == sLastBlockingConsumerCount[ xTasks ]  )
        MOV.W   R14, R13
        RLA.W   R13
        MOV.W   R14, R15
        RLA.W   R15
        CMP.W   ??sLastBlockingConsumerCount(R15), sBlockingConsumerCount(R13)
        JNE     ??xAreBlockingQueuesStillRunning_2
//  265 		{
//  266 			xReturn = pdFALSE;
        MOV.W   #0x0, R12
//  267 		}
//  268 		sLastBlockingConsumerCount[ xTasks ] = sBlockingConsumerCount[ xTasks ];
??xAreBlockingQueuesStillRunning_2:
        MOV.W   R14, R13
        RLA.W   R13
        MOV.W   R14, R15
        RLA.W   R15
        MOV.W   sBlockingConsumerCount(R13), ??sLastBlockingConsumerCount(R15)
//  269 
//  270 
//  271 		if( sBlockingProducerCount[ xTasks ] == sLastBlockingProducerCount[ xTasks ]  )
        MOV.W   R14, R13
        RLA.W   R13
        MOV.W   R14, R15
        RLA.W   R15
        CMP.W   ??sLastBlockingProducerCount(R15), sBlockingProducerCount(R13)
        JNE     ??xAreBlockingQueuesStillRunning_3
//  272 		{
//  273 			xReturn = pdFALSE;
        MOV.W   #0x0, R12
//  274 		}
//  275 		sLastBlockingProducerCount[ xTasks ] = sBlockingProducerCount[ xTasks ];
??xAreBlockingQueuesStillRunning_3:
        MOV.W   R14, R13
        RLA.W   R13
        MOV.W   R14, R15
        RLA.W   R15
        MOV.W   sBlockingProducerCount(R13), ??sLastBlockingProducerCount(R15)
//  276 	}
        ADD.W   #0x1, R14
        JMP     ??xAreBlockingQueuesStillRunning_0
//  277 
//  278 	return xReturn;
??xAreBlockingQueuesStillRunning_1:
        POP.W   R10
        CFI R10 SameValue
        CFI CFA SP+2
        RET
        CFI EndBlock cfiBlock3
//  279 }

        RSEG DATA16_Z:DATA:SORT:NOROOT(1)
        REQUIRE ?cstart_init_zero
??sLastBlockingConsumerCount:
        DS8 6

        RSEG DATA16_Z:DATA:SORT:NOROOT(1)
        REQUIRE ?cstart_init_zero
??sLastBlockingProducerCount:
        DS8 6

        RSEG CODE:CODE:REORDER:NOROOT(1)
?setjmp_save_r4:
        REQUIRE ?setjmp_r4
        REQUIRE ?longjmp_r4

        RSEG CODE:CODE:REORDER:NOROOT(1)
?setjmp_save_r5:
        REQUIRE ?setjmp_r5
        REQUIRE ?longjmp_r5

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QConsB1">`:
        DC8 "QConsB1"

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QProdB2">`:
        DC8 "QProdB2"

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QProdB3">`:
        DC8 "QProdB3"

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QConsB4">`:
        DC8 "QConsB4"

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QProdB5">`:
        DC8 "QProdB5"

        RSEG DATA16_C:CONST:SORT:NOROOT(0)
`?<Constant "QConsB6">`:
        DC8 "QConsB6"

        END
//  280 
// 
// 562 bytes in segment CODE
//  48 bytes in segment DATA16_C
//  24 bytes in segment DATA16_Z
// 
// 562 bytes of CODE  memory
//  48 bytes of CONST memory
//  24 bytes of DATA  memory
//
//Errors: none
//Warnings: none

⌨️ 快捷键说明

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