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:
parent
97fccd604d
commit
b52f445a52
1 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue