134 ** @param d |
134 ** @param d |
135 ** @param newCommunicationState |
135 ** @param newCommunicationState |
136 **/ |
136 **/ |
137 void switchCommunicationState(CO_Data* d, s_state_communication *newCommunicationState) |
137 void switchCommunicationState(CO_Data* d, s_state_communication *newCommunicationState) |
138 { |
138 { |
|
139 #ifdef CO_ENABLE_LSS |
|
140 StartOrStop(csLSS, startLSS(d), stopLSS(d)) |
|
141 #endif |
139 StartOrStop(csSDO, None, resetSDO(d)) |
142 StartOrStop(csSDO, None, resetSDO(d)) |
140 StartOrStop(csSYNC, startSYNC(d), stopSYNC(d)) |
143 StartOrStop(csSYNC, startSYNC(d), stopSYNC(d)) |
141 StartOrStop(csHeartbeat, heartbeatInit(d), heartbeatStop(d)) |
144 StartOrStop(csHeartbeat, heartbeatInit(d), heartbeatStop(d)) |
142 StartOrStop(csEmergency, emergencyInit(d), emergencyStop(d)) |
145 StartOrStop(csEmergency, emergencyInit(d), emergencyStop(d)) |
143 StartOrStop(csPDO, PDOInit(d), PDOStop(d)) |
146 StartOrStop(csPDO, PDOInit(d), PDOStop(d)) |
144 StartOrStop(csBoot_Up, None, slaveSendBootUp(d)) |
147 StartOrStop(csBoot_Up, None, slaveSendBootUp(d)) |
145 #ifdef CO_ENABLE_LSS |
|
146 StartOrStop(csLSS, startLSS(d), stopLSS(d)) |
|
147 #endif |
|
148 } |
148 } |
149 |
149 |
150 /*! |
150 /*! |
151 ** |
151 ** |
152 ** |
152 ** |
207 newState = Stopped; |
207 newState = Stopped; |
208 switchCommunicationState(d, &newCommunicationState); |
208 switchCommunicationState(d, &newCommunicationState); |
209 (*d->stopped)(d); |
209 (*d->stopped)(d); |
210 } |
210 } |
211 break; |
211 break; |
212 #ifdef CO_ENABLE_LSS |
212 default: |
213 case LssTimingDelay: |
213 return 0xFF; |
214 { |
214 |
215 s_state_communication newCommunicationState = {0, 0, 0, 0, 0, 0, 0}; |
|
216 d->nodeState = LssTimingDelay; |
|
217 newState = LssTimingDelay; |
|
218 switchCommunicationState(d, &newCommunicationState); |
|
219 } |
|
220 break; |
|
221 #endif |
|
222 }/* end switch case */ |
215 }/* end switch case */ |
223 |
216 |
224 } |
217 } |
225 /* d->nodeState contains the final state */ |
218 /* d->nodeState contains the final state */ |
226 /* may not be the requested state */ |
219 /* may not be the requested state */ |