Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ceigel
Copy link
Contributor

@ceigel ceigel commented Feb 21, 2022

Summary

[describe your changes here]

Checklist

  • CHANGELOG.md for the BSP or HAL updated
  • All new or modified code is well documented, especially public items
  • No new warnings or clippy suggestions have been introduced (see CI or check locally)

If Adding a new Board

  • Board CI added to crates.json
  • Board is properly following "Tier 2" conventions, unless otherwise decided to be "Tier 1"


[dependencies.systick-monotonic]
version = "1.0.0"
optional = true
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

@ceigel ceigel force-pushed the master branch 2 times, most recently from eea2208 to 7a32ff6 Compare February 21, 2022 21:26
#[local]
struct Local {
adc: Adc<ADC>,
adc_pin: Pin<pin::PA07, Alternate<B>>,
Copy link
Contributor

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
Copy link
Contributor

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?

@bradleyharden
Copy link
Contributor

Pinging @ceigel. Did you want to pick this back up? An RTIC example for the feather_m0 would be nice to have.

@ceigel
Copy link
Contributor Author

ceigel commented Sep 19, 2022

@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.

@ceigel
Copy link
Contributor Author

ceigel commented Sep 21, 2022

@bradleyharden I tested this on hardware. The PR is ready to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants