You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0599]: the method `get_max_duty` exists for struct `PwmChannel<TIM,C>`, but its trait bounds were not satisfied
--> base-roulante/src/main.rs:64:73
|
64 | let consigne = pid_correction / Self::MAX_CORRECTION*self.pwm.get_max_duty();
| ^^^^^^^^^^^^ method cannot be called on `PwmChannel<TIM,C>` due to unsatisfied trait bounds
|
::: /home/fomys/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32f1xx-hal-0.9.0/src/timer/pwm.rs:89:1
|
89 | pub struct PwmChannel<TIM,constC:u8> {
| --------------------------------------- doesn't satisfy `PwmChannel<TIM,C>:PwmPin`
|
= note: the following trait bounds were not satisfied:
`TIM: stm32f1xx_hal::timer::sealed::WithPwm`
`TIM: stm32f1xx_hal::timer::sealed::WithPwm`
which is required by `PwmChannel<TIM,C>:PwmPin`
The ideal resolution would be to add trait bound with WithPwm trait, but it's impossible as it's a sealed trait.
Shouldn't it be public in order write this trait bound ? If this isn't the case, how should I resolve ?
The text was updated successfully, but these errors were encountered:
I writing a generic struct that takes a pwm channel to control a motor.
We've tried this code:
And I get the following error:
The ideal resolution would be to add trait bound with
WithPwm
trait, but it's impossible as it's a sealed trait.Shouldn't it be public in order write this trait bound ? If this isn't the case, how should I resolve ?
The text was updated successfully, but these errors were encountered: