📄 pollq.lst
字号:
##############################################################################
# #
# 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\Minim #
# al\PollQ.c #
# Command line = C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\Common\Minim #
# al\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\Debu #
# g\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\Inclu #
# de\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\Source\Inc #
# lude\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\Demo\MSP #
# 430_IAR\ -I C:\MSP430F169_Eval_Port\FreeRTOSv401\Sourc #
# e\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. #
# lst #
# Object file = C:\MSP430F169_Eval_Port\FreeRTOSv401\Debug\Obj\PollQ.r #
# 43 #
# #
# #
##############################################################################
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. */
\ In segment DATA16_Z, align 2, align-sorted
\ 000000 REQUIRE ?cstart_init_zero
88 static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;
\ xPollingConsumerCount:
\ 000000 DS8 2
\ In segment DATA16_Z, align 2, align-sorted
\ 000000 REQUIRE ?cstart_init_zero
\ xPollingProducerCount:
\ 000000 DS8 2
89
90 /*-----------------------------------------------------------*/
91
\ In segment CODE, align 2
92 void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
\ vStartPolledQueueTasks:
93 {
\ 000000 0A12 PUSH.W R10
\ 000002 0A4C 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 ) );
\ 000004 2E43 MOV.W #0x2, R14
\ 000006 3C400A00 MOV.W #0xa, R12
\ 00000A B012.... CALL #xQueueCreate
\ 00000E 824C.... 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 );
^
Warning[Pe191]: type qualifier is meaningless on cast type
\ 000012 0312 PUSH.W #0x0
\ 000014 0A12 PUSH.W R10
\ 000016 3012.... PUSH.W #??xPolledQueue
\ 00001A 30124000 PUSH.W #0x40
\ 00001E 3E40.... MOV.W #`?<Constant "QConsNB">`, R14
\ 000022 3C40.... MOV.W #vPolledQueueConsumer, R12
\ 000026 B012.... CALL #xTaskCreate
101 xTaskCreate( vPolledQueueProducer, ( const signed portCHAR * const ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
^
Warning[Pe191]: type qualifier is meaningless on cast type
\ 00002A 0312 PUSH.W #0x0
\ 00002C 0A12 PUSH.W R10
\ 00002E 3012.... PUSH.W #??xPolledQueue
\ 000032 30124000 PUSH.W #0x40
\ 000036 3E40.... MOV.W #`?<Constant "QProdNB">`, R14
\ 00003A 3C40.... MOV.W #vPolledQueueProducer, R12
\ 00003E B012.... CALL #xTaskCreate
102 }
\ 000042 31501000 ADD.W #0x10, SP
\ 000046 3A41 POP.W R10
\ 000048 3041 RET
\ In segment DATA16_Z, align 2, align-sorted
\ 000000 REQUIRE ?cstart_init_zero
\ ??xPolledQueue:
\ 000000 DS8 2
103 /*-----------------------------------------------------------*/
104
\ In segment CODE, align 2
105 static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )
\ vPolledQueueProducer:
106 {
\ 000000 0A12 PUSH.W R10
\ 000002 0B12 PUSH.W R11
\ 000004 0812 PUSH.W R8
\ 000006 2183 SUB.W #0x2, SP
\ 000008 0A4C MOV.W R12, R10
107 unsigned portSHORT usValue = ( unsigned portSHORT ) 0;
\ 00000A 81430000 MOV.W #0x0, 0x0(SP)
108 signed portBASE_TYPE xError = pdFALSE, xLoop;
\ 00000E 0B43 MOV.W #0x0, R11
109
110 for( ;; )
111 {
112 for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
\ ??vPolledQueueProducer_1:
\ 000010 0843 MOV.W #0x0, R8
\ ??vPolledQueueProducer_0:
\ 000012 38900300 CMP.W #0x3, R8
\ 000016 2034 JGE ??vPolledQueueProducer_2
113 {
114 /* Send an incrementing number on the queue without blocking. */
115 if( xQueueSend( *( ( xQueueHandle * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
\ 000018 0312 PUSH.W #0x0
\ 00001A 0E41 MOV.W SP, R14
\ 00001C 2E53 ADD.W #0x2, R14
\ 00001E 2C4A MOV.W @R10, R12
\ 000020 B012.... CALL #xQueueSend
\ 000024 2153 ADD.W #0x2, SP
\ 000026 1C93 CMP.W #0x1, R12
\ 000028 0224 JEQ ??vPolledQueueProducer_3
116 {
117 /* We should never find the queue full so if we get here there
118 has been an error. */
119 xError = pdTRUE;
\ 00002A 1B43 MOV.W #0x1, R11
\ 00002C 133C JMP ??vPolledQueueProducer_4
120 }
121 else
122 {
123 if( xError == pdFALSE )
\ ??vPolledQueueProducer_3:
\ 00002E 0B93 CMP.W #0x0, R11
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -