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 configuration options to QEI interface #178

Merged
merged 3 commits into from
Jan 25, 2020
Merged

Add configuration options to QEI interface #178

merged 3 commits into from
Jan 25, 2020

Conversation

jamwaffles
Copy link
Contributor

This PR adds the QeiOptions struct which allows configuration of the timer slave mode (affecting QEI) and the QEI auto reload register value. There's also some minor formatting noise so apologies for that.

I've tested this on a Blue Pill with a CNC jog pendant that produces 400 PPR. Seems to work well.

I'm unsure of the names for everything added. They're taken almost verbatim from the datasheet, but aren't very descriptive or intuitive. Should we bikeshed this or leave it as is for now?

Copy link
Member

@TheZoq2 TheZoq2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, looks good to me.

I'm unsure of the names for everything added. They're taken almost verbatim from the datasheet, but aren't very descriptive or intuitive. Should we bikeshed this or leave it as is for now?
I think the names are fine, but the comments could use being a bit more descriptive

use cortex_m_rt::entry;
use stm32f1xx_hal::{delay::Delay, pac, prelude::*, qei::QeiOptions, timer::Timer};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the expanded version that was removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was rustfmt. Should I change it or leave it as is?

@therealprof
Copy link
Member

I prefer the rustfmt'ed version unless we establish a custom style.

I'll think we'll take it as is, thanks!

@therealprof therealprof merged commit 28b078e into stm32-rs:master Jan 25, 2020
@therealprof
Copy link
Member

@jamwaffles Oh, and of course I forgot to check and complain about the missing note in CHANGELOG.md again. Mind following up?

@jamwaffles jamwaffles deleted the qei-configuration branch January 25, 2020 13:11
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.

3 participants