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
{{ message }}
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
I need to change the subcycle_time_us of a channel after it's been initialized, but it seems to be impossible.
First, I tried PWM.clear_channel(chan) before PWM.init_channel(chan, subcycle_time_us=new_stu), but it gave an error that the channel was already initialized. Next, I tried a more draconian cleanup() call (I don't want to touch other channels, and this would mean initializing all of them which I really don't want to do, but even that didn't work.
It looks like the problem is the virtbase pointer in the channel structure. It's used throughout pwm.c to indicate whether the channel has been initialized. init_channel checks if it's set, and assumes it's initialized if it is set. But clear_channel doesn't clear it (and neither does shutdown (called by cleanup)). As there's no way to clear virtbase, there's no way to change the subcycle_time_us of a channel.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I need to change the subcycle_time_us of a channel after it's been initialized, but it seems to be impossible.
First, I tried PWM.clear_channel(chan) before PWM.init_channel(chan, subcycle_time_us=new_stu), but it gave an error that the channel was already initialized. Next, I tried a more draconian cleanup() call (I don't want to touch other channels, and this would mean initializing all of them which I really don't want to do, but even that didn't work.
It looks like the problem is the virtbase pointer in the channel structure. It's used throughout pwm.c to indicate whether the channel has been initialized. init_channel checks if it's set, and assumes it's initialized if it is set. But clear_channel doesn't clear it (and neither does shutdown (called by cleanup)). As there's no way to clear virtbase, there's no way to change the subcycle_time_us of a channel.
The text was updated successfully, but these errors were encountered: