1
0
Fork 0

This code is written on top of a driver interface only available with linux

(/proc file system) so it doesn't make sense to have other OS's trying to
open these files because they could never exist.
This commit is contained in:
curt 2004-11-18 17:40:03 +00:00
parent a1265ddc1d
commit 225af83b32

View file

@ -63,6 +63,7 @@ FGATCInput::FGATCInput( const int _board, const SGPath &_config_file ) :
// Read analog inputs // Read analog inputs
static void ATCReadAnalogInputs( int fd, unsigned char *analog_in_bytes ) { static void ATCReadAnalogInputs( int fd, unsigned char *analog_in_bytes ) {
#if defined( unix ) || defined( __CYGWIN__ )
// rewind // rewind
lseek( fd, 0, SEEK_SET ); lseek( fd, 0, SEEK_SET );
@ -71,11 +72,13 @@ static void ATCReadAnalogInputs( int fd, unsigned char *analog_in_bytes ) {
SG_LOG( SG_IO, SG_ALERT, "Read failed" ); SG_LOG( SG_IO, SG_ALERT, "Read failed" );
exit( -1 ); exit( -1 );
} }
#endif
} }
// Read status of radio switches and knobs // Read status of radio switches and knobs
static void ATCReadRadios( int fd, unsigned char *switch_data ) { static void ATCReadRadios( int fd, unsigned char *switch_data ) {
#if defined( unix ) || defined( __CYGWIN__ )
// rewind // rewind
lseek( fd, 0, SEEK_SET ); lseek( fd, 0, SEEK_SET );
@ -84,11 +87,13 @@ static void ATCReadRadios( int fd, unsigned char *switch_data ) {
SG_LOG( SG_IO, SG_ALERT, "Read failed" ); SG_LOG( SG_IO, SG_ALERT, "Read failed" );
exit( -1 ); exit( -1 );
} }
#endif
} }
// Read switch inputs // Read switch inputs
static void ATCReadSwitches( int fd, unsigned char *switch_bytes ) { static void ATCReadSwitches( int fd, unsigned char *switch_bytes ) {
#if defined( unix ) || defined( __CYGWIN__ )
// rewind // rewind
lseek( fd, 0, SEEK_SET ); lseek( fd, 0, SEEK_SET );
@ -97,6 +102,7 @@ static void ATCReadSwitches( int fd, unsigned char *switch_bytes ) {
SG_LOG( SG_IO, SG_ALERT, "Read failed" ); SG_LOG( SG_IO, SG_ALERT, "Read failed" );
exit( -1 ); exit( -1 );
} }
#endif
} }