--- a/plugins/canfestival/cf_runtime.c Mon May 26 15:25:26 2008 +0200
+++ b/plugins/canfestival/cf_runtime.c Thu May 29 17:44:11 2008 +0200
@@ -12,7 +12,7 @@
extern int common_ticktime__;
-static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId)
+static void Master_post_SlaveBootup(CO_Data* d, UNS8 nodeId)
{
/* Put the master in operational mode */
setState(d, Operational);
@@ -21,15 +21,6 @@
masterSendNMTstateChange (d, 0, NMT_Start_Node);
}
-#define NODE_DECLARE(nodename, nodeid)\
-void nodename##_preOperational()\
-{\
- ConfigureSlaveNode(&nodename##_Data, nodeid);\
-}\
-
-%(nodes_declare)s
-
-
#define NODE_INIT(nodename, nodeid) \
/* Artificially force sync state to 1 so that it is not started */\
nodename##_Data.CurrentCommunicationState.csSYNC = -1;\
@@ -54,6 +45,7 @@
if(init_level-- > 0)\
{\
EnterMutex();\
+ masterSendNMTstateChange(&nodename##_Data, 0, NMT_Reset_Node);\
setState(&nodename##_Data, Stopped);\
LeaveMutex();\
canClose(&nodename##_Data);\
@@ -73,7 +65,7 @@
}
#define NODE_OPEN(nodename)\
- nodename##_Data.preOperational = nodename##_preOperational;\
+ nodename##_Data.post_SlaveBootup = Master_post_SlaveBootup;\
if(!canOpen(&nodename##Board,&nodename##_Data)){\
printf("Cannot open " #nodename " Board (%%s,%%s)\n",nodename##Board.busname, nodename##Board.baudrate);\
return -1;\