# HG changeset patch # User etisserant # Date 1216763225 -7200 # Node ID aae8531341dfbc7083ce98dd67627bf17a4f2a88 # Parent a040156aa72fadb9516022fc7012828078c373c9 Edward's patch fixing nmtSlave compilation with LSS enabled. diff -r a040156aa72f -r aae8531341df src/nmtSlave.c --- a/src/nmtSlave.c Tue Jul 22 23:44:07 2008 +0200 +++ b/src/nmtSlave.c Tue Jul 22 23:47:05 2008 +0200 @@ -79,16 +79,26 @@ break; case NMT_Reset_Comunication: - if(d->NMT_Slave_Communications_Reset_Callback != NULL) - d->NMT_Slave_Communications_Reset_Callback(d); + { + UNS8 newNodeId = getNodeId(d); + + if(d->NMT_Slave_Communications_Reset_Callback != NULL) + d->NMT_Slave_Communications_Reset_Callback(d); #ifdef CO_ENABLE_LSS - // LSS changes NodeId here in case lss_transfer.nodeID - // doesn't match current getNodeId() - if(newNodeId!=d->lss_transfer.nodeID && newNodeId>0 && newNodeId<=127 ) - newNodeId = d->lss_transfer.nodeID; + // LSS changes NodeId here in case lss_transfer.nodeID doesn't + // match current getNodeId() + if(newNodeId!=d->lss_transfer.nodeID && newNodeId>0 && newNodeId<=127 ) + newNodeId = d->lss_transfer.nodeID; #endif - setState(d,Initialisation); - break; + + // clear old NodeId to make SetNodeId reinitializing + // SDO, EMCY and other COB Ids + *d->bDeviceNodeId = 0xFF; + + setNodeId(d, newNodeId); + } + setState(d,Initialisation); + break; }/* end switch */