/*\r
- FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.\r
+ FreeRTOS V5.4.2 - Copyright (C) 2009 Real Time Engineers Ltd.\r
\r
This file is part of the FreeRTOS distribution.\r
\r
* Simple parallel port IO routines.\r
*-----------------------------------------------------------*/\r
\r
-#define partstNUM_LEDS ( 1 )\r
-#define partstLED_OUTPUT ( 1 << 25 )\r
+#define partstLED1_OUTPUT ( 1 << 25 )\r
+#define partstLED2_OUTPUT ( 1 << 4 )\r
\r
void vParTestInitialise( void )\r
{\r
- /* Only one LED on P1.25. */\r
- GPIO1->FIODIR = partstLED_OUTPUT;\r
+ /* Set LEDs to output. */\r
+ GPIO1->FIODIR = partstLED1_OUTPUT;\r
+ GPIO0->FIODIR = partstLED2_OUTPUT;\r
\r
/* Start with LED off. */\r
- GPIO1->FIOSET = partstLED_OUTPUT;\r
+ GPIO1->FIOSET = partstLED1_OUTPUT;\r
+ GPIO0->FIOSET = partstLED2_OUTPUT;\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
/* Used to set and clear LEDs on FIO2. */\r
\r
- if( ulLEDIn < partstNUM_LEDS )\r
+ if( ulLEDIn == 0 )\r
{\r
/* Set of clear the output. */\r
if( xValue )\r
{\r
- GPIO1->FIOCLR = partstLED_OUTPUT;\r
+ GPIO1->FIOCLR = partstLED1_OUTPUT;\r
}\r
else\r
{\r
- GPIO1->FIOSET = partstLED_OUTPUT;\r
+ GPIO1->FIOSET = partstLED1_OUTPUT;\r
}\r
}\r
+ else if( ulLEDIn == 1 )\r
+ {\r
+ /* Set of clear the output. */\r
+ if( xValue )\r
+ {\r
+ GPIO0->FIOCLR = partstLED2_OUTPUT;\r
+ }\r
+ else\r
+ {\r
+ GPIO0->FIOSET = partstLED2_OUTPUT;\r
+ }\r
+ } \r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Used to toggle LEDs on FIO2. */\r
\r
- if( ulLEDIn < partstNUM_LEDS )\r
+ if( ulLEDIn == 0 )\r
{\r
/* If this bit is already set, clear it, and visa versa. */\r
ulCurrentState = GPIO1->FIOPIN;\r
- if( ulCurrentState & partstLED_OUTPUT )\r
+ if( ulCurrentState & partstLED1_OUTPUT )\r
{\r
- GPIO1->FIOCLR = partstLED_OUTPUT;\r
+ GPIO1->FIOCLR = partstLED1_OUTPUT;\r
}\r
else\r
{\r
- GPIO1->FIOSET = partstLED_OUTPUT;\r
+ GPIO1->FIOSET = partstLED1_OUTPUT;\r
}\r
}\r
+ else if( ulLEDIn == 1 )\r
+ {\r
+ /* If this bit is already set, clear it, and visa versa. */\r
+ ulCurrentState = GPIO1->FIOPIN;\r
+ if( ulCurrentState & partstLED1_OUTPUT )\r
+ {\r
+ GPIO0->FIOCLR = partstLED2_OUTPUT;\r
+ }\r
+ else\r
+ {\r
+ GPIO0->FIOSET = partstLED2_OUTPUT;\r
+ }\r
+ } \r
}\r
/*-----------------------------------------------------------*/\r
\r
long lParTestGetLEDState( void )\r
{\r
- if( ( GPIO1->FIOPIN & partstLED_OUTPUT ) != 0 )\r
+ if( ( GPIO0->FIOPIN & partstLED2_OUTPUT ) == 0 )\r
{\r
return pdFALSE;\r
}\r
/* Used to set and clear the LEDs on FIO1. */\r
if( lState != pdFALSE )\r
{\r
- GPIO1->FIOSET = partstLED_OUTPUT;\r
+ GPIO0->FIOCLR = partstLED2_OUTPUT;\r
}\r
else\r
{\r
- GPIO1->FIOCLR = partstLED_OUTPUT;\r
+ GPIO0->FIOSET = partstLED2_OUTPUT;\r
}\r
}\r
/*-----------------------------------------------------------*/\r