- Timestamp:
- 08/10/09 11:12:44 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/freeRTOS/Demo/ARM7_LPC2368_Rowley/ParTest/ParTest.c
r14 r17 53 53 54 54 #define partstFIRST_IO ( ( unsigned portLONG ) 0x01 ) 55 #define partstNUM_LEDS ( 8)55 #define partstNUM_LEDS ( 2 ) 56 56 #define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) 0xff ) 57 58 // Pin I/O LED Control Maskbit 59 #define LED1 0x02000000 // P3.25(0000 00x0 0000 0000 0000 0000 0000 0000) 60 #define LED2 0x04000000 // P3.26(0000 0x00 0000 0000 0000 0000 0000 0000) 61 62 #define LED1_ON() FIO3CLR = LED1 // LED1 Pin = 0 (ON LED) 63 #define LED1_OFF() FIO3SET = LED1 // LED1 Pin = 1 (OFF LED) 64 #define LED2_ON() FIO3CLR = LED2 // LED2 Pin = 0 (ON LED) 65 #define LED2_OFF() FIO3SET = LED2 // LED2 Pin = 1 (OFF LED) 66 67 int led_1_state; 68 int led_2_state; 69 57 70 58 71 /*----------------------------------------------------------- … … 62 75 void vParTestInitialise( void ) 63 76 { 64 PINSEL10 = 0;65 FIO2DIR = 0x000000FF;66 FIO2MASK = 0x00000000;67 FIO2CLR = 0xFF;68 SCS |= (1<<0); //fast mode for port 0 and 169 77 70 FIO2CLR = partstALL_OUTPUTS_OFF; 78 // Config Pin GPIO3[26:25] 79 PINSEL7 &= 0xFFC3FFFF; // P3[26:25] = GPIO Function(xxxx xxxx xx00 00xx xxxx xxxx xxxx xxxx) 80 PINMODE7 &= 0xFFC3FFFF; // Enable Puul-Up on P3[26:25] 81 82 FIO3DIR |= LED1; // Set GPIO-3[26:25] = Output(xxxx x11x xxxx xxxx xxxx xxxx xxxx xxxx) 83 FIO3DIR |= LED2; 84 LED1_OFF(); // Default LED Status 85 LED2_OFF(); 86 87 // PINSEL10 = 0; 88 // FIO2DIR = 0x000000FF; 89 // FIO2MASK = 0x00000000; 90 // FIO2CLR = 0xFF; 91 // SCS |= (1<<0); //fast mode for port 0 and 1 92 93 // FIO2CLR = partstALL_OUTPUTS_OFF; 71 94 } 72 95 /*-----------------------------------------------------------*/ … … 75 98 { 76 99 unsigned portLONG ulLED = partstFIRST_IO; 77 100 #if 0 78 101 if( uxLED < partstNUM_LEDS ) 79 102 { … … 91 114 } 92 115 } 116 #endif 93 117 } 94 118 /*-----------------------------------------------------------*/ … … 98 122 unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState; 99 123 124 125 if (led_1_state == 0) 126 { 127 LED1_ON(); 128 129 led_1_state = 1; 130 } 131 else 132 { 133 LED1_OFF(); 134 led_1_state = 0; 135 } 136 137 138 #if 0 100 139 if( uxLED < partstNUM_LEDS ) 101 140 { … … 115 154 } 116 155 } 156 #endif 117 157 } 118 158 … … 120 160 unsigned portBASE_TYPE uxParTextGetLED( unsigned portBASE_TYPE uxLED ) 121 161 { 162 #if 0 122 163 unsigned portLONG ulLED = partstFIRST_IO; 123 164 … … 125 166 126 167 return ( FIO2PIN & ulLED ); 168 #endif 169 return 0; 127 170 } 128 171