analogdevicesinc / gr-iio

IIO blocks for GNU Radio
GNU General Public License v3.0
94 stars 62 forks source link

lib/device_source_impl: Fix sample counter variable type. #26

Closed AlexandraTrifan closed 6 years ago

AlexandraTrifan commented 6 years ago

If the flow runs for a long time, the sample counter value reaches the maximum value accepted by the unsigned long type (4 bytes), seeing how it gets reset only if the flow stops. If this happens, the tag which signals the "buffer_start" is no longer correctly added. In order to fix this issue, we can change the sample counter variable type from unsigned long to uint64_t. This should not affect the general behaviour. Also, the gnuradio tag_t structure documentation states that the offset should be uint64_t.

Signed-off-by: Alexandra Trifan Alexandra.Trifan@analog.com

tfcollins commented 6 years ago

Might be easier to just use: nitems_written(0) https://gnuradio.org/doc/doxygen/classgr_1_1block.html#a742128a481fcb9e43a3e0cd535a57f9e

AlexandraTrifan commented 6 years ago

That's right, thanks! I updated the commit accordingly.

tfcollins commented 6 years ago

Thanks @AlexandraTrifan !