Changeset 808 for firmware/trunk/core/makingthings/io.c
- Timestamp:
- 08/11/08 13:16:57 (5 months ago)
- Files:
-
- 1 modified
-
firmware/trunk/core/makingthings/io.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/core/makingthings/io.c
r792 r808 57 57 static void Io_Init( void ); 58 58 static void Io_Deinit( void ); 59 static int Io_SetActive( int index, int value );60 static int Io_GetActive( int index );61 59 static int Io_SetOutput( int index ); 62 60 static int Io_SetInput( int index ); … … 253 251 } 254 252 255 // static 256 int Io_SetActive( int index, int value ) 257 { 258 if ( value ) 259 return Io_Start( index, false ); 260 else 261 return Io_Stop( index ); 262 return CONTROLLER_OK; 263 } 264 265 // static 266 int Io_GetActive( int index ) 253 /** 254 Read whether an IO pin is in use. 255 @param index An int specifying which IO line. Use the appropriate entry from the \ref IoIndices 256 @param output Specify 1 for an output, or 0 for an input. 257 @return non-zero if active, 0 if inactive 258 259 \b Example 260 \code 261 if( Io_GetActive( IO_PA23 ) ) 262 { 263 // it's already active 264 } 265 else 266 { 267 // not yet active 268 } 269 \endcode 270 */ 271 bool Io_GetActive( int index ) 267 272 { 268 273 if ( index < 0 || index > IO_PIN_COUNT ) … … 941 946 switch ( property ) 942 947 { 943 case 0: 944 Io_SetActive( index, value ); 948 case 0: 949 if(value) 950 Io_Start( index, false ); 951 else 952 Io_Stop( index ); 945 953 break; 946 954 case 1:
