Implemented delimiter for cstruct command.
authorFlorian Pose <fp@igh-essen.com>
Tue, 06 Jul 2010 20:23:08 +0200
changeset 1949 bde584664aa2
parent 1948 fa1c4fb0a8da
child 1950 237b71828a9d
Implemented delimiter for cstruct command.
TODO
tool/CommandCStruct.cpp
--- a/TODO	Tue Jul 06 17:40:20 2010 +0200
+++ b/TODO	Tue Jul 06 20:23:08 2010 +0200
@@ -31,8 +31,6 @@
     - Implement --output-file argument in foe_read.
     - Fix arguments of reg_read.
     - Number layout for reg_read.
-    - Implement identifier parameter for cstruct command.
-    - Implement sync delimiter for cstruct command.
     - Implement indent in 'ethercat ma'
     - Implement 0xXXXX:YY format for specifying SDOs.
     - Implement reading from stream for soe_write.
--- a/tool/CommandCStruct.cpp	Tue Jul 06 17:40:20 2010 +0200
+++ b/tool/CommandCStruct.cpp	Tue Jul 06 20:23:08 2010 +0200
@@ -117,7 +117,7 @@
     for (i = 0; i < slave.sync_count; i++) {
         m.getSync(&sync, slave.position, i);
 
-        syncs << "   {" << dec << sync.sync_index
+        syncs << "    {" << dec << sync.sync_index
             << ", " << (EC_READ_BIT(&sync.control_register, 2) ?
                     "EC_DIR_OUTPUT" : "EC_DIR_INPUT")
             << ", " << dec << (unsigned int) sync.pdo_count
@@ -136,7 +136,7 @@
         for (j = 0; j < sync.pdo_count; j++) {
             m.getPdo(&pdo, slave.position, i, j);
 
-            pdos << "   {0x" << hex << setfill('0')
+            pdos << "    {0x" << hex << setfill('0')
                 << setw(4) << pdo.index
                 << ", " << dec << (unsigned int) pdo.entry_count
                 << ", ";
@@ -155,7 +155,7 @@
             for (k = 0; k < pdo.entry_count; k++) {
                 m.getPdoEntry(&entry, slave.position, i, j, k);
 
-                entries << "   {0x" << hex << setfill('0')
+                entries << "    {0x" << hex << setfill('0')
                     << setw(4) << entry.index
                     << ", 0x" << setw(2) << (unsigned int) entry.subindex
                     << ", " << dec << (unsigned int) entry.bit_length
@@ -201,6 +201,7 @@
 
     cout << "ec_sync_info_t " << id.str() << "syncs[] = {" << endl
         << syncs.str()
+        << "    {0xff}" << endl
         << "};" << endl
         << endl;
 }