***************************************************************************\r
*/\r
\r
-/* Hardware specific includes. */\r
-#include "mb91467d.h"\r
\r
/* Scheduler includes. */\r
#include "FreeRTOS.h"\r
\r
#define partstNUM_LEDs 8\r
\r
-static unsigned portSHORT sState[ partstNUM_LEDs ] = { pdFALSE };\r
+static unsigned portCHAR sState[ 2 ] = { 0xFF, 0xFF };\r
\r
/*-----------------------------------------------------------*/\r
void vParTestInitialise( void )\r
{\r
- /* Set port for LED outputs. */\r
- DDR16 = 0xFF;\r
-\r
- /* Start with LEDs off. */\r
- PDR25 = 0x00;\r
+ DDR00 = 0xFF;\r
+ PDR00 = 0xFF;\r
+ DDR09 = 0xFF;\r
+ PDR09 = 0xFF;\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
if( uxLED < partstNUM_LEDs )\r
{\r
- taskENTER_CRITICAL();\r
- \r
+ vTaskSuspendAll();\r
+\r
/* Toggle the state of the single genuine on board LED. */\r
- if( sState[ uxLED ]) \r
+ if( ( sState[ 0 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 )\r
{\r
- PDR25 |= ( 1 << uxLED );\r
+ PDR09 |= ( 1 << uxLED );\r
+ sState[ 0 ] |= ( 1 << uxLED );\r
}\r
else\r
{\r
- PDR25 &= ~( 1 << uxLED );\r
+ PDR09 &= ~( 1 << uxLED );\r
+ sState[ 0 ] &= ~( 1 << uxLED );\r
}\r
- \r
- sState[ uxLED ] = !( sState[ uxLED ] );\r
- \r
- taskEXIT_CRITICAL();\r
+\r
+ xTaskResumeAll();\r
+ }\r
+ else\r
+ {\r
+ vTaskSuspendAll();\r
+\r
+ uxLED -= partstNUM_LEDs;\r
+\r
+ if( ( sState[ 1 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 )\r
+ {\r
+ PDR00 |= ( 1 << uxLED );\r
+ sState[ 1 ] |= ( 1 << uxLED );\r
+ }\r
+ else\r
+ {\r
+ PDR00 &= ~( 1 << uxLED );\r
+ sState[ 1 ] &= ~( 1 << uxLED );\r
+ }\r
+\r
+ xTaskResumeAll();\r
}\r
}\r
/*-----------------------------------------------------------*/\r
/* Set or clear the output [in this case show or hide the '*' character. */\r
if( uxLED < partstNUM_LEDs )\r
{\r
- taskENTER_CRITICAL();\r
+ vTaskSuspendAll();\r
{\r
if( xValue )\r
{\r
- PDR25 |= ( 1 << uxLED );\r
- sState[ uxLED ] = 1;\r
+ PDR09 &= ~( 1 << uxLED );\r
+ sState[ 0 ] &= ~( 1 << uxLED );\r
}\r
else\r
{\r
- PDR25 &= ~( 1 << uxLED );\r
- sState[ uxLED ] = 0;\r
+ PDR09 |= ( 1 << uxLED );\r
+ sState[ 0 ] |= ( 1 << uxLED );\r
}\r
}\r
- taskEXIT_CRITICAL();\r
+\r
+ xTaskResumeAll();\r
+ }\r
+ else\r
+ {\r
+ vTaskSuspendAll();\r
+ {\r
+ if( xValue )\r
+ {\r
+ PDR00 &= ~( 1 << uxLED );\r
+ sState[ 1 ] &= ~( 1 << uxLED );\r
+ }\r
+ else\r
+ {\r
+ PDR00 |= ( 1 << uxLED );\r
+ sState[ 1 ] |= ( 1 << uxLED );\r
+ }\r
+ }\r
+\r
+ xTaskResumeAll();\r
}\r
}\r
-/*-----------------------------------------------------------*/\r
\r