Implemented delimiter for cstruct command.

This commit is contained in:
Florian Pose 2010-07-06 20:23:08 +02:00
parent 5531b692ee
commit 2266cdc4aa
2 changed files with 4 additions and 5 deletions

2
TODO
View File

@ -31,8 +31,6 @@ Version 1.5.0:
- 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.

View File

@ -117,7 +117,7 @@ void CommandCStruct::generateSlaveCStruct(
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 @@ void CommandCStruct::generateSlaveCStruct(
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 @@ void CommandCStruct::generateSlaveCStruct(
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 @@ void CommandCStruct::generateSlaveCStruct(
cout << "ec_sync_info_t " << id.str() << "syncs[] = {" << endl
<< syncs.str()
<< " {0xff}" << endl
<< "};" << endl
<< endl;
}