examples/TestMasterSlave/TestMasterSlave.c
changeset 381 854c43cdc24a
parent 343 118c1cabd0b0
child 454 bc000083297a
equal deleted inserted replaced
380:fe47568b8281 381:854c43cdc24a
    92 /***************************  INIT  *****************************************/
    92 /***************************  INIT  *****************************************/
    93 void InitNodes(CO_Data* d, UNS32 id)
    93 void InitNodes(CO_Data* d, UNS32 id)
    94 {
    94 {
    95 	/****************************** INITIALISATION SLAVE *******************************/
    95 	/****************************** INITIALISATION SLAVE *******************************/
    96 	if(strcmp(SlaveBoard.baudrate, "none")) {
    96 	if(strcmp(SlaveBoard.baudrate, "none")) {
    97 
       
    98 #ifdef CO_ENABLE_LSS
       
    99 		/* Set an invalid nodeID */
       
   100 		setNodeId(&TestSlave_Data, 0xFF);
       
   101 #else
       
   102 		setNodeId(&TestSlave_Data, 0x02);
    97 		setNodeId(&TestSlave_Data, 0x02);
   103 #endif
       
   104 
    98 
   105 		/* init */
    99 		/* init */
   106 		setState(&TestSlave_Data, Initialisation);
   100 		setState(&TestSlave_Data, Initialisation);
   107 	}
   101 	}
   108 
   102 
   200 		TestSlave_Data.stopped = TestSlave_stopped;
   194 		TestSlave_Data.stopped = TestSlave_stopped;
   201 		TestSlave_Data.post_sync = TestSlave_post_sync;
   195 		TestSlave_Data.post_sync = TestSlave_post_sync;
   202 		TestSlave_Data.post_TPDO = TestSlave_post_TPDO;
   196 		TestSlave_Data.post_TPDO = TestSlave_post_TPDO;
   203 		TestSlave_Data.storeODSubIndex = TestSlave_storeODSubIndex;
   197 		TestSlave_Data.storeODSubIndex = TestSlave_storeODSubIndex;
   204 		TestSlave_Data.post_emcy = TestSlave_post_emcy;
   198 		TestSlave_Data.post_emcy = TestSlave_post_emcy;
   205 #ifdef CO_ENABLE_LSS
       
   206 		/* in this example the slave doesn't support Store configuration*/
       
   207 		//TestSlave_Data.lss_StoreConfiguration = TestSlave_StoreConfiguration;
       
   208 		TestSlave_Data.lss_ChangeBaudRate=TestSlave_ChangeBaudRate;
       
   209 #endif
       
   210 
   199 
   211 		if(!canOpen(&SlaveBoard,&TestSlave_Data)){
   200 		if(!canOpen(&SlaveBoard,&TestSlave_Data)){
   212 			eprintf("Cannot open Slave Board (%s,%s)\n",SlaveBoard.busname, SlaveBoard.baudrate);
   201 			eprintf("Cannot open Slave Board (%s,%s)\n",SlaveBoard.busname, SlaveBoard.baudrate);
   213 			goto fail_slave;
   202 			goto fail_slave;
   214 		}
   203 		}