Don not copy frame data to datagram memory, if datagram type is write-only.
--- a/master/master.c Fri Sep 16 09:25:02 2011 +0200
+++ b/master/master.c Fri Sep 16 12:44:54 2011 +0200
@@ -1172,8 +1172,12 @@
domain_data += domain_fmmu->data_size;
i++;
}
- } else {
- // copy received data into the datagram memory
+ } else if (datagram->type != EC_DATAGRAM_APWR &&
+ datagram->type != EC_DATAGRAM_FPWR &&
+ datagram->type != EC_DATAGRAM_BWR &&
+ datagram->type != EC_DATAGRAM_LWR) {
+ // copy received data into the datagram memory,
+ // if something has been read
memcpy(datagram->data, frame_datagram_data, data_size);
}