Skip to content

Commit 8bb71d7

Browse files
committed
ADC: fix for non-sequential iio channel indices
Signed-off-by: Andrei Popa <[email protected]>
1 parent 1dc1f33 commit 8bb71d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gr-util/src/griiodevicesource.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ void GRIIODeviceSource::addChannelAtIndex(iio_device *iio_dev, QString channelNa
8686
QString::fromStdString(m_channelNames[idx]) != channelName) {
8787
idx++;
8888
}
89+
90+
// channel indexes may be larger then the ch count
91+
if(idx >= m_channelNames.size()) {
92+
m_channelNames.resize(idx + 1);
93+
}
8994
m_channelNames[idx] = channel_name;
9095
}
9196

0 commit comments

Comments
 (0)