src/states.c
changeset 365 9b76e0881beb
parent 349 1e6dd4ef46b9
child 370 6fecf36df407
equal deleted inserted replaced
364:17edd8a028fa 365:9b76e0881beb
    65 ** @param d                                                                                        
    65 ** @param d                                                                                        
    66 ** @param m                                                                                        
    66 ** @param m                                                                                        
    67 **/  
    67 **/  
    68 void canDispatch(CO_Data* d, Message *m)
    68 void canDispatch(CO_Data* d, Message *m)
    69 {
    69 {
    70 	 switch(m->cob_id.w >> 7)
    70 	 switch(m->cob_id >> 7)
    71 	{
    71 	{
    72 		case SYNC:		/* can be a SYNC or a EMCY message */
    72 		case SYNC:		/* can be a SYNC or a EMCY message */
    73 			if(m->cob_id.w == 0x080)	/* SYNC */
    73 			if(m->cob_id == 0x080)	/* SYNC */
    74 			{
    74 			{
    75 				if(d->CurrentCommunicationState.csSYNC)
    75 				if(d->CurrentCommunicationState.csSYNC)
    76 					proceedSYNC(d);
    76 					proceedSYNC(d);
    77 			} else 		/* EMCY */
    77 			} else 		/* EMCY */
    78 				if(d->CurrentCommunicationState.csEmergency)
    78 				if(d->CurrentCommunicationState.csEmergency)
   105 				proceedNMTstateChange(d,m);
   105 				proceedNMTstateChange(d,m);
   106 			}
   106 			}
   107 #ifdef CO_ENABLE_LSS
   107 #ifdef CO_ENABLE_LSS
   108 		case LSS:
   108 		case LSS:
   109 			if (!d->CurrentCommunicationState.csLSS)break;
   109 			if (!d->CurrentCommunicationState.csLSS)break;
   110 			if ((*(d->iam_a_slave)) && m->cob_id.w==MLSS_ADRESS)
   110 			if ((*(d->iam_a_slave)) && m->cob_id==MLSS_ADRESS)
   111 			{
   111 			{
   112 				proceedLSS_Slave(d,m);
   112 				proceedLSS_Slave(d,m);
   113 			}
   113 			}
   114 			else if(!(*(d->iam_a_slave)) && m->cob_id.w==SLSS_ADRESS)
   114 			else if(!(*(d->iam_a_slave)) && m->cob_id==SLSS_ADRESS)
   115 			{
   115 			{
   116 				proceedLSS_Master(d,m);
   116 				proceedLSS_Master(d,m);
   117 			}
   117 			}
   118 			break;
   118 			break;
   119 #endif
   119 #endif