-
Notifications
You must be signed in to change notification settings - Fork 843
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
Add an example to read VBUS and VSYS #331
Add an example to read VBUS and VSYS #331
Conversation
Hmmm, just occurred to me that maybe this example should be using the binary_info stuff too? |
c12333f
to
2d3cb99
Compare
The process is different on Pico and Pico W so demonstrate how to do it. Fixes raspberrypi#324
2d3cb99
to
d534ada
Compare
LGTM (although I've not actually tried testing it). |
cyw43 needs to be on to read vbus. Low values are read when cyw43 goes to sleep (or wakes up?)
#if CYW43_USES_VSYS_PIN | ||
cyw43_thread_enter(); | ||
// Make sure cyw43 is awake | ||
cyw43_arch_gpio_get(CYW43_WL_GPIO_VBUS_PIN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cyw43_arch_gpio_get
communicates with the wifi chip, and also calls to cyw43_thread_enter
and cyw43_thread_exit
.
Would that not cause conflicts and or release our lock too soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you seeing an issue? You can nest calls to enter and exit so I wouldn't expect this to be a problem.
The process is different on Pico and Pico W so demonstrate how to do it.
Fixes #324