Fixed typo
authorEdouard Tisserant
Tue, 19 Jun 2012 21:59:34 +0200
changeset 779 7499535588e6
parent 778 4f9e6d9a3d98
child 787 f49875b9e946
Fixed typo
canfestival/canfestival.py
--- a/canfestival/canfestival.py	Tue Jun 19 10:11:43 2012 +0200
+++ b/canfestival/canfestival.py	Tue Jun 19 21:59:34 2012 +0200
@@ -434,6 +434,12 @@
                 # register previously declared func as post_SlaveBootup callback for that node
                 format_dict["slavebootup_register"] += (
                     "%s_Data.post_SlaveBootup = %s_post_SlaveBootup;\n"%(nodename,nodename))
+                format_dict["pre_op"] += (
+                    "static void %s_preOperational(CO_Data* d){\n    "%(nodename)+
+                    "".join(["    masterSendNMTstateChange(d, %d, NMT_Reset_Comunication);\n"%NdId for NdId in SlaveIDs])+
+                    "}\n")
+                format_dict["pre_op_register"] += (
+                    "%s_Data.preOperational = %s_preOperational;\n"%(nodename,nodename))
             else:
                 # Slave node
                 align = child_data.getSync_Align()
@@ -451,12 +457,6 @@
                         "}\n")
                     format_dict["post_sync_register"] += (
                         "%s_Data.post_sync = %s_post_sync;\n"%(nodename,nodename))
-                    format_dict["pre_op"] += (
-                        "static void %s_preOperational(CO_Data* d){\n    "%(nodename)+
-                        "".join(["    if(check_and_start_node(d, %d)!=1) return;\n"%NdId for NdId in SlaveIDs])+
-                        "}\n")
-                    format_dict["pre_op_register"] += (
-                        "%s_Data.preOperational = %s_pre_op;\n"%(nodename,nodename))
                 format_dict["nodes_init"] += 'NODE_SLAVE_INIT(%s, %s)\n    '%(
                        nodename,
                        child_data.getNodeId())