2 FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.
\r
4 This file is part of the FreeRTOS.org distribution.
\r
6 FreeRTOS.org is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 FreeRTOS.org is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with FreeRTOS.org; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 A special exception to the GPL can be applied should you wish to distribute
\r
21 a combined work that includes FreeRTOS.org, without being obliged to provide
\r
22 the source code for any proprietary components. See the licensing section
\r
23 of http://www.FreeRTOS.org for full details of how and when the exception
\r
26 ***************************************************************************
\r
28 Please ensure to read the configuration and relevant port sections of the
\r
29 online documentation.
\r
31 +++ http://www.FreeRTOS.org +++
\r
32 Documentation, latest information, license and contact details.
\r
34 +++ http://www.SafeRTOS.com +++
\r
35 A version that is certified for use in safety critical systems.
\r
37 +++ http://www.OpenRTOS.com +++
\r
38 Commercial support, development, porting, licensing and training services.
\r
40 ***************************************************************************
\r
44 /* Scheduler includes. */
\r
45 #include "FreeRTOS.h"
\r
48 #define partstNUM_LEDs 8
\r
50 static unsigned portCHAR sState[ 2 ] = { 0xFF, 0xFF };
\r
51 static unsigned portSHORT sState1[ partstNUM_LEDs ] = { pdFALSE };
\r
53 /*-----------------------------------------------------------*/
\r
54 void vParTestInitialise( void )
\r
57 /* Set port for LED outputs. */
\r
61 /* Start with LEDs off. */
\r
71 /*-----------------------------------------------------------*/
\r
73 void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
\r
75 if( uxLED < partstNUM_LEDs )
\r
78 taskENTER_CRITICAL();
\r
82 /* Toggle the state of the single genuine on board LED. */
\r
83 if( ( sState[ 0 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 )
\r
87 /* Toggle the state of the single genuine on board LED. */
\r
88 if( sState[ uxLED ])
\r
90 PDR25 |= ( 1 << uxLED );
\r
94 PDR25 &= ~( 1 << uxLED );
\r
97 sState[ uxLED ] = !( sState[ uxLED ] );
\r
99 taskEXIT_CRITICAL();
\r
101 PDR09 |= ( 1 << uxLED );
\r
102 sState[ 0 ] |= ( 1 << uxLED );
\r
106 PDR09 &= ~( 1 << uxLED );
\r
107 sState[ 0 ] &= ~( 1 << uxLED );
\r
116 uxLED -= partstNUM_LEDs;
\r
118 if( uxLED < partstNUM_LEDs )
\r
120 taskENTER_CRITICAL();
\r
122 /* Toggle the state of the single genuine on board LED. */
\r
123 if( sState1[uxLED])
\r
125 PDR16 |= ( 1 << uxLED );
\r
129 PDR16 &= ~( 1 << uxLED );
\r
132 sState1[ uxLED ] = !( sState1[ uxLED ] );
\r
134 taskEXIT_CRITICAL();
\r
142 uxLED -= partstNUM_LEDs;
\r
144 if( ( sState[ 1 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 )
\r
146 PDR00 |= ( 1 << uxLED );
\r
147 sState[ 1 ] |= ( 1 << uxLED );
\r
151 PDR00 &= ~( 1 << uxLED );
\r
152 sState[ 1 ] &= ~( 1 << uxLED );
\r
159 /*-----------------------------------------------------------*/
\r
161 void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
\r
163 /* Set or clear the output [in this case show or hide the '*' character. */
\r
164 if( uxLED < partstNUM_LEDs )
\r
170 PDR09 &= ~( 1 << uxLED );
\r
171 sState[ 0 ] &= ~( 1 << uxLED );
\r
175 PDR09 |= ( 1 << uxLED );
\r
176 sState[ 0 ] |= ( 1 << uxLED );
\r
185 uxLED -= partstNUM_LEDs;
\r
187 if( uxLED < partstNUM_LEDs )
\r
189 taskENTER_CRITICAL();
\r
193 PDR16 |= (1 << uxLED);
\r
194 sState1[uxLED] = 1;
\r
198 PDR16 &= ~(1 << uxLED);
\r
199 sState1[uxLED] = 0;
\r
202 taskEXIT_CRITICAL();
\r
212 PDR00 &= ~( 1 << uxLED );
\r
213 sState[ 1 ] &= ~( 1 << uxLED );
\r
217 PDR00 |= ( 1 << uxLED );
\r
218 sState[ 1 ] |= ( 1 << uxLED );
\r