Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libserialport libxml2
Diff: device.c
- Revision:
- 4:ad69b39bf124
- Parent:
- 3:d147beabba0e
--- a/device.c Mon Jan 30 13:00:39 2017 +0000 +++ b/device.c Mon Jun 26 14:30:10 2017 +0000 @@ -427,6 +427,7 @@ { ssize_t size = 0; unsigned int i; + const struct iio_channel *prev = NULL; if (words != (dev->nb_channels + 31) / 32) return -EINVAL; @@ -438,15 +439,20 @@ if (chn->index < 0) break; - if (!TEST_BIT(mask, chn->index)) + if (!TEST_BIT(mask, chn->number)) continue; - if (i > 0 && chn->index == dev->channels[i - 1]->index) + + if (prev && chn->index == prev->index) { + prev = chn; continue; + } if (size % length) size += 2 * length - (size % length); else size += length; + + prev = chn; } return size; }