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

fix: remove bogus sampling rate check #39

Closed
wants to merge 1 commit into from

Conversation

wucke13
Copy link

@wucke13 wucke13 commented Mar 10, 2024

The plutosdr only accepts a value of datatype integer as sampling rate. For this, there already is a conversion logic, to convert float data type sampling rate values to integer data type. However, the conversion logic is flawed, as it only triggers for values of float data type if the floating point number has decimals (digits behind the dot). Therefore, values of floating point data type like 10 or 25000 are not converted to an integer data type, resulting in failure to initialize the plutosdr.

This patch removes the bogus check, always converting to integer type.

This is a fix to #38

The plutosdr only accepts a value of datatype integer as sampling rate.
For this, there already is a conversion logic, to convert float data
type sampling rate values to integer data type. However, the conversion
logic is flawed, as it only triggers for values of float data type
**if the floating point number has decimals** (digits behind the dot).
Therefore, values of floating point data type like `10` or `25000`
are not converted to an integer data type, resulting in failure to
initialize the plutosdr.

This patch removes the bogus check, always converting to integer type.

This is a fix to igorauad#38 /
@wucke13
Copy link
Author

wucke13 commented Jun 23, 2024

@igorauad Any chance that you take a look at this?

igorauad added a commit that referenced this pull request Jul 28, 2024
igorauad added a commit that referenced this pull request Jul 28, 2024
@igorauad igorauad closed this in 130c315 Jul 28, 2024
@igorauad
Copy link
Owner

@wucke13 thanks a lot for the PR. I ended up choosing a slightly different approach in 130c315. To avoid confusion, I'm checking for integer sample rates directly at the arguments parser. The parser won't let the application run if the chosen sample rate is non-integer with the PlutoSDR. Let me know if you still have any problems after that. Thanks again!

@wucke13
Copy link
Author

wucke13 commented Aug 2, 2024

@igorauad great to see some movement here! I guess your approach is ok. It still bugs me to make the sampling rate a float, which then is checked for figures after the digit, but I guess the logic is sound now.

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