Master now sends NMT_Reset only from default preOperational application callback
--- a/src/states.c Mon Jun 18 19:38:40 2012 +0200
+++ b/src/states.c Tue Jun 19 10:29:03 2012 +0200
@@ -181,10 +181,6 @@
s_state_communication newCommunicationState = {0, 1, 1, 1, 1, 0, 1};
d->nodeState = Pre_operational;
switchCommunicationState(d, &newCommunicationState);
- if (!(*(d->iam_a_slave)))
- {
- masterSendNMTstateChange (d, 0, NMT_Reset_Node);
- }
(*d->preOperational)(d);
}
break;
@@ -313,6 +309,11 @@
}
void _initialisation(CO_Data* d){}
-void _preOperational(CO_Data* d){}
+void _preOperational(CO_Data* d){
+ if (!(*(d->iam_a_slave)))
+ {
+ masterSendNMTstateChange (d, 0, NMT_Reset_Node);
+ }
+}
void _operational(CO_Data* d){}
void _stopped(CO_Data* d){}