diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-03-01 08:20:28 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-03-01 08:20:28 +0100 |
commit | a923ca34734decc31eb38e89c9e7353569a4dc6e (patch) | |
tree | e5b924ae9ea642f5c1504e8ab24ae31b56f0489b /libk8055/main.c | |
parent | 52139c71e12fe91955dc5d23c072c5662e906f52 (diff) | |
download | k8055-a923ca34734decc31eb38e89c9e7353569a4dc6e.zip k8055-a923ca34734decc31eb38e89c9e7353569a4dc6e.tar.gz |
prefix C function with k8055_
Diffstat (limited to 'libk8055/main.c')
-rw-r--r-- | libk8055/main.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libk8055/main.c b/libk8055/main.c index 4a22514..055d045 100644 --- a/libk8055/main.c +++ b/libk8055/main.c @@ -60,7 +60,7 @@ inline int str2int( char* text, int* i ) { } static void display_help ( char* params[] ) { - printf( "K8055 version %s MrBrain Build\n",version() ); + printf( "K8055 version %s MrBrain Build\n",k8055_version() ); printf( "Copyright (C) 2004 by Nicolas Sutre\n" ); printf( "Copyright (C) 2005 by Bob Dempsey\n" ); printf( "Copyright (C) 2005 by Julien Etelain and Edward Nys\n" ); @@ -111,7 +111,7 @@ int read_param( int argc, char* params[] ) { !str2int( params[i]+6,&dbt2 ) ) erreurParam = true; else if ( !strcmp( params[i],"-debug" ) ) { debug = 1; - set_debug_on(); + k8055_set_debug_on(); } else if ( !strcmp( params[i],"-reset1" ) ) resetcnt1 = true; else if ( !strcmp( params[i],"-reset2" ) ) resetcnt2 = true; else if ( !strcmp( params[i],"--help" ) ) { @@ -155,41 +155,41 @@ int main ( int argc,char* params[] ) { if ( debug ) usb_set_debug( 2 ); struct k8055_dev dev; - if ( open_device( &dev, ipid )<0 ) { + if ( k8055_open_device( &dev, ipid )<0 ) { printf( "Could not open the k8055 (port:%d)\nPlease ensure that the device is correctly connected.\n",ipid ); return ( EXIT_FAILURE ); } else { if ( resetcnt1 ) - reset_counter( &dev,1 ); + k8055_reset_counter( &dev,1 ); if ( resetcnt2 ) - reset_counter( &dev,2 ); + k8055_reset_counter( &dev,2 ); if ( dbt1 != -1 ) - set_counter_debounce_time( &dev,1,dbt1 ); + k8055_set_counter_debounce_time( &dev,1,dbt1 ); if ( dbt2 != -1 ) - set_counter_debounce_time( &dev,2,dbt1 ); + k8055_set_counter_debounce_time( &dev,2,dbt1 ); if ( ( ia1!=-1 ) && ( ia2!=-1 ) && ( id8!=-1 ) ) { - result = set_all_values( &dev,id8,ia1,ia2 ); + result = k8055_set_all_values( &dev,id8,ia1,ia2 ); if ( debug ) printf( "SetAllValues=%d - Digital:%d, analog1:%d, analog2:%d\n",result,id8,ia1,ia2 ); } else if ( ( id8 != -1 ) && ( ia1!=-1 ) ) { - result = set_all_values( &dev,id8,ia1,0 ); + result = k8055_set_all_values( &dev,id8,ia1,0 ); if ( debug ) printf( "SetAllValues=%d - Digital:%d, analog1:%d\n",result,id8,ia1 ); } else if ( ( id8 != -1 ) && ( ia2!=-1 ) ) { - result = set_all_values( &dev,id8,0,ia2 ); + result = k8055_set_all_values( &dev,id8,0,ia2 ); if ( debug ) printf( "SetAllValues=%d - Digital:%d, analog2:%d\n",result,id8,ia2 ); } else if ( ( ia1 != -1 ) && ( ia2!=-1 ) ) { - result = set_all_values( &dev,0,ia1,ia2 ); + result = k8055_set_all_values( &dev,0,ia1,ia2 ); if ( debug ) printf( "SetAllValues=%d - analog1:%d, analog2:%d\n",result,ia1,ia2 ); } else { if ( ia1!=-1 ) { - result=output_analog_channel( &dev,1,ia1 ); + result=k8055_output_analog_channel( &dev,1,ia1 ); if ( debug ) printf( "Set analog1:%d=>%d\n",ia1,result ); } if ( ia2!=-1 ) { - result=output_analog_channel( &dev,2,ia2 ); + result=k8055_output_analog_channel( &dev,2,ia2 ); if ( debug ) printf( "Set analog2:%d=>%d\n",ia2,result ); } if ( id8!=-1 ) { - result=write_all_digital( &dev,( long )id8 ); + result=k8055_write_all_digital( &dev,( long )id8 ); if ( debug ) printf( "Set digital:%d=>%d\n",id8,result ); } } @@ -198,11 +198,11 @@ int main ( int argc,char* params[] ) { if ( delay ) { while ( time_msec()-mstart < i*delay ); } - read_all_values( &dev,&d,&a1,&a2,&c1,&c2 ); + k8055_read_all_values( &dev,&d,&a1,&a2,&c1,&c2 ); lastcall = time_msec(); printf( "%d;%d;%d;%d;%d;%d\n", ( int )( lastcall-start ),( int )d, ( int )a1, ( int )a2,( int )c1,( int )c2 ); } - close_device( &dev ); + k8055_close_device( &dev ); } } return EXIT_SUCCESS; |