Fixed working counter calculation when process data of the same slave are

split into separate datagrams.
This commit is contained in:
Florian Pose 2018-11-12 15:02:49 +01:00
parent 23b3d31737
commit 0257660396
1 changed files with 6 additions and 6 deletions

View File

@ -269,12 +269,6 @@ int ec_domain_finish(
// Correct logical FMMU address
fmmu->logical_start_address += base_address;
// Increment Input/Output counter to determine datagram types
// and calculate expected working counters
if (shall_count(fmmu, datagram_first_fmmu)) {
datagram_used[fmmu->dir]++;
}
// If the current FMMU's data do not fit in the current datagram,
// allocate a new one.
if (datagram_size + fmmu->data_size > EC_MAX_DATA_SIZE) {
@ -293,6 +287,12 @@ int ec_domain_finish(
datagram_first_fmmu = fmmu;
}
// Increment Input/Output counter to determine datagram types
// and calculate expected working counters
if (shall_count(fmmu, datagram_first_fmmu)) {
datagram_used[fmmu->dir]++;
}
datagram_size += fmmu->data_size;
}