embedded-hal icon indicating copy to clipboard operation
embedded-hal copied to clipboard

[WIP] Initial proposal for CancellableOneShot

Open chrysn opened this issue 6 years ago • 2 comments
trafficstars

Add a trait that extends OneShot and allows cancellation, along with an incomplete example.

This is a first shot at #123; not ready for review as in "ensure we can merge this", but pushed into a PR to have actual discussion material in #123.

chrysn avatar Jan 31 '19 17:01 chrysn

... but does not compile:

122 | pub trait CancellableOneShot<ADC, Word, Pin: Channel<ADC>>: OneShot<ADC, Word, Pin, Channel<ADC>> {
    |                                                                                     ^^^^^^^^^^^^ unexpected type argument

therealprof avatar Jan 31 '19 18:01 therealprof

Oups, tested without the unproven feature.

Fixed, and cargo +nightly test --features unproven now runs through the test as well after having ironed out the details.

chrysn avatar Jan 31 '19 19:01 chrysn