Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins/dac_data_manager: Create iio buffer at the right moment #506

Open
wants to merge 1 commit into
base: libiio-v1-support
Choose a base branch
from

Conversation

dNechita
Copy link
Contributor

PR Description

The idea behind the fix is the following: due to libiio v1.x API changes the creation of the iio_buffer cannot be done too early. It needs a iio_mask and at least one channel to be enabled. The need to create the iio_buffer early was just to read one attribute about alignment, and to read the attribute only once.

The fix is to create the iio_buffer at the moment is needed and read the attribute right after the creation.

The effort for this fix started because osc was crashing at startup.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have followed the coding standards and guidelines
  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked in CI output that no new warnings/errors got introduced
  • I have updated documentation accordingly (GitHub Pages, READMEs, etc)

This prevents osc from crashing at startup.
The idea behind the fix is the following: due to libiio v1.x API
changes the creation of the iio_buffer cannot be done too early.
It needs a iio_mask and at least one channel to be enabled.
The need to create the iio_buffer early was just to read one
attribute about alignment, and to read the attribute only once.

The fix is to create the iio_buffer at the moment is needed and
read the attribute right after the creation.

Signed-off-by: Dan <[email protected]>
Copy link
Contributor

@mhennerich mhennerich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants