examples/TestMasterSlaveLSS/Master.c
changeset 718 0b33d9cdbdeb
parent 717 cfb4f62f35af
equal deleted inserted replaced
717:cfb4f62f35af 718:0b33d9cdbdeb
   130                     0); /*UNS8 useBlockMode*/
   130                     0); /*UNS8 useBlockMode*/
   131 					break;
   131 					break;
   132 		case 2: /* Second step : Set the new heartbeat producer time in the slave */
   132 		case 2: /* Second step : Set the new heartbeat producer time in the slave */
   133 		{
   133 		{
   134 			UNS32 Master_Cons_Heartbeat_T=Master_Cons_Heartbeat_Base + (nodeId * 0x10000);
   134 			UNS32 Master_Cons_Heartbeat_T=Master_Cons_Heartbeat_Base + (nodeId * 0x10000);
   135 			UNS8 size = sizeof(UNS32); 
   135 			UNS32 size = sizeof(UNS32); 
   136 			
   136 			
   137 			eprintf("Master : set slave %2.2x Producer Heartbeat Time = %d\n", nodeId,Slave_Prod_Heartbeat_T);
   137 			eprintf("Master : set slave %2.2x Producer Heartbeat Time = %d\n", nodeId,Slave_Prod_Heartbeat_T);
   138 			res = writeNetworkDictCallBack (d, /*CO_Data* d*/
   138 			res = writeNetworkDictCallBack (d, /*CO_Data* d*/
   139 					nodeId, /*UNS8 nodeId*/
   139 					nodeId, /*UNS8 nodeId*/
   140 					0x1017, /*UNS16 index*/
   140 					0x1017, /*UNS16 index*/
   212    			break;
   212    			break;
   213    		case LSS_CONF_ACT_BIT_TIMING:
   213    		case LSS_CONF_ACT_BIT_TIMING:
   214    			if(dat1==0){
   214    			if(dat1==0){
   215    				UNS8 LSS_mode=LSS_WAITING_MODE;
   215    				UNS8 LSS_mode=LSS_WAITING_MODE;
   216 				UNS32 SINC_cicle=50000;// us
   216 				UNS32 SINC_cicle=50000;// us
   217 				UNS8 size = sizeof(UNS32); 
   217 				UNS32 size = sizeof(UNS32); 
   218 	
   218 	
   219 				/* The slaves are now configured (nodeId and Baudrate) via the LSS services.
   219 				/* The slaves are now configured (nodeId and Baudrate) via the LSS services.
   220    			 	* Switch the LSS state to WAITING and restart the slaves. */
   220    			 	* Switch the LSS state to WAITING and restart the slaves. */
   221 				
   221 				
   222 				/*TODO: change the baud rate of the master!!*/
   222 				/*TODO: change the baud rate of the master!!*/