-
Notifications
You must be signed in to change notification settings - Fork 181
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
Unable to store ADC handles in a struct #493
Comments
You are fighting a basic Rust problem, not something related to |
thanks a lot. It worked even that I don't like to wrap everything in arc or refcells... but it seams that's the way rust handle these things. |
Not necessarily. There are other ways, in that you can store in your struct a |
Hello,
I would like to create a driver that should read an ADC channel. The idea is to create a struct storing the handles in a new function and then use it afterwards. With the legacy ADC driver this was possible due to the fact that there was no direct link between ADCDriver and ADCChannelDriver. However, the new ADCChannelDriver requires a reference to the ADCDriver. If storing this to a struct, the compiler complains that the reference is a local variable.
Do I understand something wrong? Is there a more obvious solution to achieve something similar?
The compiler error:
The text was updated successfully, but these errors were encountered: