-
Notifications
You must be signed in to change notification settings - Fork 204
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 new example of ADC with RTIC using SysTick as monotonic #575
base: master
Are you sure you want to change the base?
Conversation
boards/feather_m0/Cargo.toml
Outdated
|
||
[dependencies.systick-monotonic] | ||
version = "1.0.0" | ||
optional = true |
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.
As this is a dependency only in an example, it should go in dev-dependencies
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.
Same with rtt stuff I think
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.
@TDHolmes thank you for your suggestions. I applied them to the PR.
eea2208
to
7a32ff6
Compare
#[local] | ||
struct Local { | ||
adc: Adc<ADC>, | ||
adc_pin: Pin<pin::PA07, Alternate<B>>, |
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.
It might be nice to add a pin alias to the bsp_pins!
macro for this case.
let max_range = 1 << RESOLUTION_BITS; | ||
let voltage = ((data as f32) * 3.3 * 2.0) / (max_range as f32); | ||
rprintln!("Battery level {} - {}", voltage, data); | ||
// If the LED were a local resource, the lock would not be necessary |
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.
What is this comment referring to? Is it a copy/paste artifact?
Pinging @ceigel. Did you want to pick this back up? An RTIC example for the |
@bradleyharden sorry for the delay. I addressed the comments. I haven't tested it on hardware with the new changes. I will do that in the following days. |
@bradleyharden I tested this on hardware. The PR is ready to be merged. |
@ceigel, Not sure if you're still interested in working on this, but I'll be happy to merge this if you want to bring the example up to speed with the current master. |
Summary
[describe your changes here]
Checklist
CHANGELOG.md
for the BSP or HAL updatedIf Adding a new Board
crates.json