Fixed herbeat timer array partial initialization in generated OD code.
authoretisserant
Thu, 20 Mar 2008 13:40:32 +0100
changeset 422 43a4d6deb007
parent 421 6221b4db8c42
child 423 d60363d872dd
Fixed herbeat timer array partial initialization in generated OD code.
examples/DS401_Master/TestMaster.c
examples/DS401_Slave_Gui/ObjDict.c
examples/TestMasterMicroMod/TestMaster.c
examples/TestMasterSlave/TestMaster.c
objdictgen/gen_cfile.py
--- a/examples/DS401_Master/TestMaster.c	Thu Mar 20 11:41:06 2008 +0100
+++ b/examples/DS401_Master/TestMaster.c	Thu Mar 20 13:40:32 2008 +0100
@@ -54,7 +54,7 @@
 
 const UNS8 TestMaster_iam_a_slave = 0;
 
-TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,};
+TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE};
 
 /*
 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--- a/examples/DS401_Slave_Gui/ObjDict.c	Thu Mar 20 11:41:06 2008 +0100
+++ b/examples/DS401_Slave_Gui/ObjDict.c	Thu Mar 20 13:40:32 2008 +0100
@@ -101,7 +101,7 @@
 
 const UNS8 ObjDict_iam_a_slave = 1;
 
-TIMER_HANDLE ObjDict_heartBeatTimers[3] = {TIMER_NONE,};
+TIMER_HANDLE ObjDict_heartBeatTimers[3] = {TIMER_NONE,TIMER_NONE,TIMER_NONE};
 
 /*
 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--- a/examples/TestMasterMicroMod/TestMaster.c	Thu Mar 20 11:41:06 2008 +0100
+++ b/examples/TestMasterMicroMod/TestMaster.c	Thu Mar 20 13:40:32 2008 +0100
@@ -42,7 +42,7 @@
 
 const UNS8 TestMaster_iam_a_slave = 0;
 
-TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,};
+TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE};
 
 /*
 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--- a/examples/TestMasterSlave/TestMaster.c	Thu Mar 20 11:41:06 2008 +0100
+++ b/examples/TestMasterSlave/TestMaster.c	Thu Mar 20 13:40:32 2008 +0100
@@ -46,7 +46,7 @@
 
 const UNS8 TestMaster_iam_a_slave = 0;
 
-TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,};
+TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE};
 
 /*
 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--- a/objdictgen/gen_cfile.py	Thu Mar 20 11:41:06 2008 +0100
+++ b/objdictgen/gen_cfile.py	Thu Mar 20 13:40:32 2008 +0100
@@ -480,7 +480,9 @@
 
 """%texts
     if texts["heartBeatTimers_number"] > 0:
-        fileContent += "TIMER_HANDLE %(NodeName)s_heartBeatTimers[%(heartBeatTimers_number)d] = {TIMER_NONE,};\n"%texts
+        declaration = "TIMER_HANDLE %(NodeName)s_heartBeatTimers[%(heartBeatTimers_number)d]"%texts
+        initializer = "{TIMER_NONE" + ",TIMER_NONE" * (texts["heartBeatTimers_number"] - 1) + "}"
+        fileContent += declaration + " = " + initializer + ";\n"
     else:
         fileContent += "TIMER_HANDLE %(NodeName)s_heartBeatTimers[1];\n"%texts