Skip to content

Commit d3e9631

Browse files
committed
Add define for index in legacy header file CO_OD.h
1 parent 5f60e2e commit d3e9631

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libEDSsharp/CanOpenNodeExporter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ ALIASES FOR OBJECT DICTIONARY VARIABLES
760760
default:
761761
{
762762
file.WriteLine(string.Format("/*{0:X4}, Data Type: {1} */", od.Index, t.ToString()));
763+
file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString()));
763764
file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", make_cname(od.parameter_name,od)), loc, make_cname(od.parameter_name,od)));
764765

765766
DataType dt = od.datatype;
@@ -777,6 +778,7 @@ ALIASES FOR OBJECT DICTIONARY VARIABLES
777778
DataType dt = od.datatype;
778779

779780
file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}, Array[{2}] */", od.Index, t.ToString(), od.Nosubindexes - 1));
781+
file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString()));
780782
file.WriteLine(string.Format(" #define OD_{0,-48} {1}.{2}", make_cname(od.parameter_name,od), loc, make_cname(od.parameter_name,od)));
781783
file.WriteLine(string.Format(" #define {0,-51} {1}", string.Format("ODL_{0}_arrayLength", make_cname(od.parameter_name,od)), od.Nosubindexes - 1));
782784

@@ -825,6 +827,7 @@ ALIASES FOR OBJECT DICTIONARY VARIABLES
825827
if (!constructed_rec_types.Contains(rectype))
826828
{
827829
file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}_t */", od.Index, rectype));
830+
file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString()));
828831
file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", rectype), loc, rectype));
829832
constructed_rec_types.Add(rectype);
830833
file.WriteLine("");

0 commit comments

Comments
 (0)