Modification of 0x1016 index c code generation
authorlbessard
Thu, 06 Dec 2007 17:58:43 +0100
changeset 325 65b1b2d9e20b
parent 324 c6865f99747a
child 326 98a83c4194b5
Modification of 0x1016 index c code generation
objdictgen/gen_cfile.py
--- a/objdictgen/gen_cfile.py	Thu Dec 06 17:57:21 2007 +0100
+++ b/objdictgen/gen_cfile.py	Thu Dec 06 17:58:43 2007 +0100
@@ -371,20 +371,16 @@
 """%texts
 
     if 0x1016 in communicationlist:
-        texts["nombre"] = Node.GetEntry(0x1016, 0)
+        texts["heartBeatTimers_number"] = Node.GetEntry(0x1016, 0)
     else:
-        texts["nombre"] = 0
+        texts["heartBeatTimers_number"] = 0
         entry_infos = Node.GetEntryInfos(0x1016)
         texts["EntryName"] = entry_infos["name"]
         indexContents[0x1016] = """\n/* index 0x1016 :   %(EntryName)s */
                     UNS8 %(NodeName)s_highestSubIndex_obj1016 = 0;
                     UNS32 %(NodeName)s_obj1016[]={0};
 """%texts
-    if texts["nombre"] > 0:
-        strTimers = "TIMER_HANDLE %(NodeName)s_heartBeatTimers[%(nombre)d] = {TIMER_NONE,};\n"%texts
-    else:
-        strTimers = "TIMER_HANDLE %(NodeName)s_heartBeatTimers[1];\n"%texts
-
+    
     if 0x1017 not in communicationlist:
         entry_infos = Node.GetEntryInfos(0x1017)
         texts["EntryName"] = entry_infos["name"]
@@ -459,7 +455,10 @@
 const UNS8 %(NodeName)s_iam_a_slave = %(iam_a_slave)d;
 
 """%texts
-    fileContent += strTimers
+    if texts["heartBeatTimers_number"] > 0:
+        fileContent += "TIMER_HANDLE %(NodeName)s_heartBeatTimers[%(heartBeatTimers_number)d] = {TIMER_NONE,};\n"%texts
+    else:
+        fileContent += "TIMER_HANDLE %(NodeName)s_heartBeatTimers[1];\n"%texts
     
     fileContent += """
 /*