# HG changeset patch # User etisserant # Date 1176894355 -7200 # Node ID 90c0a676e631d5e26ce67c29530980095c73c251 # Parent f379cdef1f8ea5f73df67752d31898386d6a3c16 Removed compilation warnings with some GCC. + Fixed test for baudrate = none diff -r f379cdef1f8e -r 90c0a676e631 examples/TestMasterMicroMod/TestMasterMicroMod.c --- a/examples/TestMasterMicroMod/TestMasterMicroMod.c Wed Apr 18 13:05:15 2007 +0200 +++ b/examples/TestMasterMicroMod/TestMasterMicroMod.c Wed Apr 18 13:05:55 2007 +0200 @@ -28,6 +28,7 @@ system("PAUSE"); } #else +#include #include #include #include @@ -241,11 +242,11 @@ printf("* *\n"); printf("* A simple example for PC. *\n"); printf("* A CanOpen master that control a MicroMod module: *\n"); - printf("* - setup module TPDO 1 transmit type (ignored ???) *\n"); - printf("* - setup module RPDO 1 transmit type (ignored ???) *\n"); + printf("* - setup module TPDO 1 transmit type (ignored ?) *\n"); + printf("* - setup module RPDO 1 transmit type (ignored ?) *\n"); printf("* - setup module hearbeatbeat period *\n"); printf("* - set state to operational *\n"); - printf("* - send periodic SYNC (ignored ???) *\n"); + printf("* - send periodic SYNC (ignored ?) *\n"); printf("* - send periodic RPDO 1 to Micromod (digital output) *\n"); printf("* - listen Micromod's TPDO 1 (digital input) *\n"); printf("* *\n"); @@ -260,7 +261,7 @@ printf("* *\n"); printf("* Master: *\n"); printf("* -m : bus name [\"1\"] *\n"); - printf("* -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) *\n"); + printf("* -M : 1M,500K,250K,125K,100K,50K,20K,10K *\n"); printf("* *\n"); printf("**************************************************************\n"); } @@ -341,21 +342,18 @@ LoadCanDriver(LibraryPath); #endif - if(MasterBoard.baudrate){ - - TestMaster_Data.heartbeatError = TestMaster_heartbeatError; - TestMaster_Data.SDOtimeoutError = TestMaster_SDOtimeoutError; - TestMaster_Data.initialisation = TestMaster_initialisation; - TestMaster_Data.preOperational = TestMaster_preOperational; - TestMaster_Data.operational = TestMaster_operational; - TestMaster_Data.stopped = TestMaster_stopped; - TestMaster_Data.post_sync = TestMaster_post_sync; - TestMaster_Data.post_TPDO = TestMaster_post_TPDO; - - if(!canOpen(&MasterBoard,&TestMaster_Data)){ - eprintf("Cannot open Master Board\n"); - goto fail_master; - } + TestMaster_Data.heartbeatError = TestMaster_heartbeatError; + TestMaster_Data.SDOtimeoutError = TestMaster_SDOtimeoutError; + TestMaster_Data.initialisation = TestMaster_initialisation; + TestMaster_Data.preOperational = TestMaster_preOperational; + TestMaster_Data.operational = TestMaster_operational; + TestMaster_Data.stopped = TestMaster_stopped; + TestMaster_Data.post_sync = TestMaster_post_sync; + TestMaster_Data.post_TPDO = TestMaster_post_TPDO; + + if(!canOpen(&MasterBoard,&TestMaster_Data)){ + eprintf("Cannot open Master Board\n"); + goto fail_master; } // Start timer thread diff -r f379cdef1f8e -r 90c0a676e631 examples/TestMasterSlave/TestMasterSlave.c --- a/examples/TestMasterSlave/TestMasterSlave.c Wed Apr 18 13:05:15 2007 +0200 +++ b/examples/TestMasterSlave/TestMasterSlave.c Wed Apr 18 13:05:55 2007 +0200 @@ -30,8 +30,7 @@ #else #include #include -//#include -//#include +#include #include #include #endif @@ -189,7 +188,7 @@ LoadCanDriver(LibraryPath); #endif // Open CAN devices - if(SlaveBoard.baudrate){ + if(strcmp( SlaveBoard.baudrate, "none")){ TestSlave_Data.heartbeatError = TestSlave_heartbeatError; TestSlave_Data.SDOtimeoutError = TestSlave_SDOtimeoutError; @@ -207,7 +206,7 @@ } } - if(MasterBoard.baudrate){ + if(strcmp( MasterBoard.baudrate, "none")){ TestMaster_Data.heartbeatError = TestMaster_heartbeatError; TestMaster_Data.SDOtimeoutError = TestMaster_SDOtimeoutError;