Changeset 775
- Timestamp:
- 07/31/08 13:20:15 (4 months ago)
- Location:
- firmware/trunk/libraries/dipswitch
- Files:
-
- 2 modified
-
dipswitch.c (modified) (1 diff)
-
dipswitch.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/libraries/dipswitch/dipswitch.c
r704 r775 116 116 117 117 return r; 118 } 119 120 /** 121 Read a single channel's value. 122 @param channel The channel (0-7) you'd like to read. 123 return true if the channel is on, false if it's off. 124 @see DipSwitch_GetValue( ) 125 */ 126 bool DipSwitch_GetValueChannel( int channel ) 127 { 128 if( channel < 0 || channel > 7 ) 129 return CONTROLLER_ERROR_ILLEGAL_INDEX; 130 131 int val = DipSwitch_GetValue(); 132 if( val < 0 ) 133 return false; 134 else 135 return ((val << channel) & 0x1); 118 136 } 119 137 -
firmware/trunk/libraries/dipswitch/dipswitch.h
r693 r775 31 31 32 32 int DipSwitch_GetValue( void ); 33 bool DipSwitch_GetValueChannel( int channel ); 33 34 34 35 bool DipSwitch_GetAutoSend( bool init );
