-
Notifications
You must be signed in to change notification settings - Fork 191
PCNT implementation for v4 esp-idf api (will work for on v5 with v4 api) #157
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
Conversation
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.
some under qualified comments 😄
pass pins as PeripheralRef store PinDriver in PcntPin
pass pins as PeripheralRef store PinDriver in PcntPin
…into pcnt_idf_v4
requires update in esp-idf-sys to choose implementation uses pcnt on esp-idf 4 uses pulse_cnt by default on esp-idf 5
update example to support either
Will try to review over the weekend. In the process of releasing |
Take your time. I'm mostly AFK until the 27th. |
I already reviewed 4.4 driver. Next one coming over the weekend. |
Actually, if you can address the feedback for the V4 driver first. We can review the V5 one after that. |
use PinIndex to specify pins to a channel
@ivmarkov should I remove the |
Yes please. We might re-introduce it once we have the V5 driver as well. |
src/pcnt.rs
Outdated
/// returns | ||
/// - () | ||
/// - EspError | ||
pub fn channel_config<'a>( |
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.
Why do we need to provide the config after the driver has been created? Is this having any real use case?
Wait. You still have the V5 version lurking around in |
@liebman For the V5 driver:
|
I'll remove it and make a new PR after we're done with v4 - without a change in |
yea - removing v5 for a later PR. I also do not like the new interface as it's misleading in a few ways, in particular the channel allocation (will there be more than 2 in future hardware?) and watch points (current hardware has only one that the user can set, the others (limit and zero) can't be changed (future hardware?). |
fix #cfg's for when/where pcnt is available
@ivmarkov we can attempt the workflow again. I've run clippy on the following targets:
and rerun fmt. |
no need for `not(feature = "riscv-ulp-hal")` as pcnt is not included for `riscv-ulp-hal`
@ivmarkov ready for another workflow attempt |
- use println!() instead of log::info!() in pcnt example
@ivmarkov the compile error was coming from |
@liebman Can you fix the remaining errors (perhaps replace |
I tried
but that gives a link error (bug?)
I'm going with this I think (compiles fine)
|
V4 api only (v5 will be a later PR)