📄 pollq.s43
字号:
//////////////////////////////////////////////////////////////////////////////
// /
// IAR MSP430 C/C++ Compiler V3.41A/W32 22/Apr/2006 00:25:13 /
// Copyright 1996-2006 IAR Systems. All rights reserved. /
// /
// __rt_version = 2 /
// __double_size = 32 /
// __reg_r4 = free /
// __reg_r5 = free /
// __pic = no /
// __core = 64kb /
// Source file = C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\Common\Mini /
// mal\PollQ.c /
// Command line = C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\Common\Mini /
// mal\PollQ.c -D ROWLEY_MSP430 -D IAR_MSP430 -lC /
// C:\MSP430F169_Eval_Port\FreeRTOSv401\Debug\List\ -lA /
// C:\MSP430F169_Eval_Port\FreeRTOSv401\Debug\List\ /
// --remarks -o C:\MSP430F169_Eval_Port\FreeRTOSv401\Deb /
// ug\Obj\ -s2 --no_cse --no_unroll --no_inline /
// --no_code_motion --no_tbaa --debug -e /
// --migration_preprocessor_extensions --double=32 -I /
// C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\Common\Incl /
// ude\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\Source\I /
// nclude\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\ /
// MSP430_IAR\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\S /
// ource\portable\msp430f1611\ -I "C:\Program Files\IAR /
// Systems\Embedded Workbench 4.0\430\INC\" -I /
// "C:\Program Files\IAR Systems\Embedded Workbench /
// 4.0\430\INC\CLIB\" /
// List file = C:\MSP430F169_Eval_Port\FreeRTOSv401\Debug\List\PollQ /
// .s43 /
// /
// /
//////////////////////////////////////////////////////////////////////////////
NAME PollQ
RTMODEL "__core", "64kb"
RTMODEL "__double_size", "32"
RTMODEL "__pic", "no"
RTMODEL "__reg_r4", "free"
RTMODEL "__reg_r5", "free"
RTMODEL "__rt_version", "2"
RSEG CSTACK:DATA:SORT:NOROOT(1)
EXTERN ?Epilogue3
EXTERN ?cstart_init_zero
EXTERN ?longjmp_r4
EXTERN ?longjmp_r5
EXTERN ?setjmp_r4
EXTERN ?setjmp_r5
PUBWEAK ?setjmp_save_r4
PUBWEAK ?setjmp_save_r5
FUNCTION vPolledQueueConsumer,021603H
LOCFRAME CSTACK, 12, STACK
FUNCTION vPolledQueueProducer,021603H
LOCFRAME CSTACK, 12, STACK
PUBLIC vStartPolledQueueTasks
FUNCTION vStartPolledQueueTasks,021203H
LOCFRAME CSTACK, 20, STACK
PUBLIC xArePollingQueuesStillRunning
FUNCTION xArePollingQueuesStillRunning,0203H
LOCFRAME CSTACK, 2, STACK
CFI Names cfiNames0
CFI StackFrame CFA SP DATA
CFI Resource PC:16, SP:16, SR:16, R4:16, R5:16, R6:16, R7:16, R8:16
CFI Resource R9:16, R10:16, R11:16, R12:16, R13:16, R14:16, R15:16
CFI EndNames cfiNames0
CFI Common cfiCommon0 Using cfiNames0
CFI CodeAlign 2
CFI DataAlign 2
CFI ReturnAddress PC CODE
CFI CFA SP+2
CFI PC Frame(CFA, -2)
CFI SR Undefined
CFI R4 SameValue
CFI R5 SameValue
CFI R6 SameValue
CFI R7 SameValue
CFI R8 SameValue
CFI R9 SameValue
CFI R10 SameValue
CFI R11 SameValue
CFI R12 Undefined
CFI R13 Undefined
CFI R14 Undefined
CFI R15 Undefined
CFI EndCommon cfiCommon0
EXTERN uxQueueMessagesWaiting
FUNCTION uxQueueMessagesWaiting,0202H
EXTERN xQueueReceive
FUNCTION xQueueReceive,0202H
EXTERN usCriticalNesting
EXTERN vTaskDelay
FUNCTION vTaskDelay,0202H
EXTERN xQueueSend
FUNCTION xQueueSend,0202H
EXTERN xQueueCreate
FUNCTION xQueueCreate,0202H
EXTERN xTaskCreate
FUNCTION xTaskCreate,0202H
// C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\Common\Minimal\PollQ.c
// 1 /*
// 2 FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
// 3
// 4 This file is part of the FreeRTOS distribution.
// 5
// 6 FreeRTOS is free software; you can redistribute it and/or modify
// 7 it under the terms of the GNU General Public License as published by
// 8 the Free Software Foundation; either version 2 of the License, or
// 9 (at your option) any later version.
// 10
// 11 FreeRTOS is distributed in the hope that it will be useful,
// 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
// 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// 14 GNU General Public License for more details.
// 15
// 16 You should have received a copy of the GNU General Public License
// 17 along with FreeRTOS; if not, write to the Free Software
// 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// 19
// 20 A special exception to the GPL can be applied should you wish to distribute
// 21 a combined work that includes FreeRTOS, without being obliged to provide
// 22 the source code for any proprietary components. See the licensing section
// 23 of http://www.FreeRTOS.org for full details of how and when the exception
// 24 can be applied.
// 25
// 26 ***************************************************************************
// 27 See http://www.FreeRTOS.org for documentation, latest information, license
// 28 and contact details. Please ensure to read the configuration and relevant
// 29 port sections of the online documentation.
// 30 ***************************************************************************
// 31 */
// 32
// 33 /*
// 34 * This version of PollQ. c is for use on systems that have limited stack
// 35 * space and no display facilities. The complete version can be found in
// 36 * the Demo/Common/Full directory.
// 37 *
// 38 * Creates two tasks that communicate over a single queue. One task acts as a
// 39 * producer, the other a consumer.
// 40 *
// 41 * The producer loops for three iteration, posting an incrementing number onto the
// 42 * queue each cycle. It then delays for a fixed period before doing exactly the
// 43 * same again.
// 44 *
// 45 * The consumer loops emptying the queue. Each item removed from the queue is
// 46 * checked to ensure it contains the expected value. When the queue is empty it
// 47 * blocks for a fixed period, then does the same again.
// 48 *
// 49 * All queue access is performed without blocking. The consumer completely empties
// 50 * the queue each time it runs so the producer should never find the queue full.
// 51 *
// 52 * An error is flagged if the consumer obtains an unexpected value or the producer
// 53 * find the queue is full.
// 54 */
// 55
// 56 /*
// 57 Changes from V2.0.0
// 58
// 59 + Delay periods are now specified using variables and constants of
// 60 portTickType rather than unsigned portLONG.
// 61 */
// 62
// 63 #include <stdlib.h>
// 64
// 65 /* Scheduler include files. */
// 66 #include "FreeRTOS.h"
// 67 #include "task.h"
// 68 #include "queue.h"
// 69
// 70 /* Demo program include files. */
// 71 #include "PollQ.h"
// 72
// 73 #define pollqSTACK_SIZE configMINIMAL_STACK_SIZE
// 74 #define pollqQUEUE_SIZE ( 10 )
// 75 #define pollqDELAY ( ( portTickType ) 200 / portTICK_RATE_MS )
// 76 #define pollqNO_DELAY ( ( portTickType ) 0 )
// 77 #define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )
// 78 #define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )
// 79
// 80 /* The task that posts the incrementing number onto the queue. */
// 81 static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );
// 82
// 83 /* The task that empties the queue. */
// 84 static portTASK_FUNCTION_PROTO( vPolledQueueConsumer, pvParameters );
// 85
// 86 /* Variables that are used to check that the tasks are still running with no
// 87 errors. */
RSEG DATA16_Z:DATA:SORT:NOROOT(1)
REQUIRE ?cstart_init_zero
// 88 static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;
xPollingConsumerCount:
DS8 2
RSEG DATA16_Z:DATA:SORT:NOROOT(1)
REQUIRE ?cstart_init_zero
xPollingProducerCount:
DS8 2
// 89
// 90 /*-----------------------------------------------------------*/
// 91
RSEG CODE:CODE:REORDER:NOROOT(1)
// 92 void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
vStartPolledQueueTasks:
CFI Block cfiBlock0 Using cfiCommon0
CFI Function vStartPolledQueueTasks
// 93 {
FUNCALL vStartPolledQueueTasks, xQueueCreate
LOCFRAME CSTACK, 4, STACK
FUNCALL vStartPolledQueueTasks, xTaskCreate
LOCFRAME CSTACK, 12, STACK
FUNCALL vStartPolledQueueTasks, xTaskCreate
LOCFRAME CSTACK, 20, STACK
PUSH.W R10
CFI R10 Frame(CFA, -4)
CFI CFA SP+4
MOV.W R12, R10
// 94 static xQueueHandle xPolledQueue;
// 95
// 96 /* Create the queue used by the producer and consumer. */
// 97 xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
MOV.W #0x2, R14
MOV.W #0xa, R12
CALL #xQueueCreate
MOV.W R12, &??xPolledQueue
// 98
// 99 /* Spawn the producer and consumer. */
// 100 xTaskCreate( vPolledQueueConsumer, ( const signed portCHAR * const ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
PUSH.W #0x0
CFI CFA SP+6
PUSH.W R10
CFI CFA SP+8
PUSH.W #??xPolledQueue
CFI CFA SP+10
PUSH.W #0x40
CFI CFA SP+12
MOV.W #`?<Constant "QConsNB">`, R14
MOV.W #vPolledQueueConsumer, R12
CALL #xTaskCreate
// 101 xTaskCreate( vPolledQueueProducer, ( const signed portCHAR * const ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
PUSH.W #0x0
CFI CFA SP+14
PUSH.W R10
CFI CFA SP+16
PUSH.W #??xPolledQueue
CFI CFA SP+18
PUSH.W #0x40
CFI CFA SP+20
MOV.W #`?<Constant "QProdNB">`, R14
MOV.W #vPolledQueueProducer, R12
CALL #xTaskCreate
// 102 }
ADD.W #0x10, SP
CFI CFA SP+4
POP.W R10
CFI R10 SameValue
CFI CFA SP+2
RET
CFI EndBlock cfiBlock0
RSEG DATA16_Z:DATA:SORT:NOROOT(1)
REQUIRE ?cstart_init_zero
??xPolledQueue:
DS8 2
// 103 /*-----------------------------------------------------------*/
// 104
RSEG CODE:CODE:REORDER:NOROOT(1)
// 105 static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )
vPolledQueueProducer:
CFI Block cfiBlock1 Using cfiCommon0
CFI Function vPolledQueueProducer
// 106 {
FUNCALL vPolledQueueProducer, xQueueSend
LOCFRAME CSTACK, 12, STACK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -