1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fpga: handle receving more data than size of configured signals

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2024-08-14 09:49:30 +02:00 committed by Niklas Eiling
parent 97fccd604d
commit b52f445a52

View file

@ -270,6 +270,12 @@ int FpgaNode::fastRead(Sample *smps[], unsigned cnt) {
smp->length = 0;
for (unsigned i = 0; i < MIN(read / sizeof(uint32_t), smp->capacity); i++) {
if (i >= in.signals->size()) {
logger->warn(
"Received more data than expected. Maybe the descriptor cache needs "
"to be invalidated?. Ignoring the rest of the data.");
break;
}
if (in.signals->getByIndex(i)->type == SignalType::INTEGER) {
smp->data[i].i = static_cast<int64_t>((*accessorRx)[i]);
} else {