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

Switch FPGA API's to be dynamically loaded (Try 2) #33

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

ThadHouse
Copy link
Contributor

I realized I went completely overboard with the API changes in the other PR. I'd still like to look into those, but this just changes to the dynamically loaded API without changing anything else, and no API changes at the high level.

Copy link
Member

@auscompgeek auscompgeek left a comment

Choose a reason for hiding this comment

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

I was wondering when you'd be done with the other PR 😅

My main concern is around the dlopen error newtype, but looks reasonable otherwise.

ni-fpga-sys/src/dlopenerror.rs Outdated Show resolved Hide resolved
ni-fpga-sys/src/dlopenerror.rs Outdated Show resolved Hide resolved
@ThadHouse
Copy link
Contributor Author

This should now not be any breaking changes. Slightly less descriptive errors in extreme edge cases, but they're impossible to hit with our use of the dlopen library.

NullCharacter() => Not possible, since we control the one use of "NiFpga", and all other strings are function names which can't have null anyway.
NullSymbol => Can only happen when loading data symbols, which we don't do anyway.
AddrNotMatchingDll(
) => Somehow a pointer to a non loaded library is requested. Again not possible with how we expose.

I actually debated just panicing when any of these cases occured, but I think just a generic error is fine. The common errors are mapped properly to the FPGA status they would have normally had.

@auscompgeek auscompgeek merged commit e926e0e into first-rust-competition:master Sep 7, 2023
1 check passed
@auscompgeek auscompgeek linked an issue Sep 8, 2023 that may be closed by this pull request
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.

Linker issues with "cargo build" in Windows?
2 participants