Skip to content

Commit 90c3c3e

Browse files
committed
Remove unproven feature
1 parent 4a4ff0c commit 90c3c3e

File tree

11 files changed

+12
-73
lines changed

11 files changed

+12
-73
lines changed

Cargo.toml

+2-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ readme = "README.md"
1414
repository = "https://github.com/rust-embedded/embedded-hal"
1515
version = "0.2.3"
1616

17-
[dependencies.nb]
18-
version = "0.1.1"
17+
[dependencies]
18+
nb = { version = "0.1.1", features = ["unstable"] }
1919

2020
[dev-dependencies]
2121
stm32f3 = { version = "0.8", features = ["stm32f303", "rt"] }
2222
futures = "0.1.17"
2323

24-
[features]
25-
unproven = ["nb/unstable"]
26-
27-
[package.metadata.docs.rs]
28-
features = ["unproven"]

ci/script.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ set -euxo pipefail
22

33
main() {
44
cargo check --target $TARGET
5-
cargo check --target $TARGET --features unproven
65
cargo fmt -- --check
76

87
if [ $TRAVIS_RUST_VERSION = nightly ]; then
9-
cargo test --target $TARGET --features unproven
8+
cargo test --target $TARGET
109
fi
1110
}
1211

src/adc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Analog-digital conversion traits
22
3-
#[cfg(feature = "unproven")]
43
use nb;
54

65
/// A marker trait to identify MCU pins that can be used as inputs to an ADC channel.
@@ -35,7 +34,6 @@ use nb;
3534
/// fn channel() -> (u8, u8) { (0, 3) } // bank 0 channel 3
3635
/// }
3736
/// ```
38-
#[cfg(feature = "unproven")]
3937
pub trait Channel<ADC> {
4038
/// Channel ID type
4139
///
@@ -85,7 +83,6 @@ pub trait Channel<ADC> {
8583
/// }
8684
/// }
8785
/// ```
88-
#[cfg(feature = "unproven")]
8986
pub trait OneShot<ADC, Word, Pin: Channel<ADC>> {
9087
/// Error type returned by ADC methods
9188
type Error;

src/blocking/i2c.rs

-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ pub trait Write {
5656
}
5757

5858
/// Blocking write (iterator version)
59-
#[cfg(feature = "unproven")]
6059
pub trait WriteIter {
6160
/// Error type
6261
type Error;
@@ -107,7 +106,6 @@ pub trait WriteRead {
107106
}
108107

109108
/// Blocking write (iterator version) + read
110-
#[cfg(feature = "unproven")]
111109
pub trait WriteIterRead {
112110
/// Error type
113111
type Error;

src/blocking/rng.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! Blocking hardware random number generator
22
33
/// Blocking read
4-
///
5-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
6-
#[cfg(feature = "unproven")]
74
pub trait Read {
85
/// Error type
96
type Error;

src/blocking/spi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub trait Write<W> {
1919
}
2020

2121
/// Blocking write (iterator version)
22-
#[cfg(feature = "unproven")]
2322
pub trait WriteIter<W> {
2423
/// Error type
2524
type Error;
@@ -78,7 +77,6 @@ pub mod write {
7877
}
7978

8079
/// Blocking write (iterator version)
81-
#[cfg(feature = "unproven")]
8280
pub mod write_iter {
8381
/// Default implementation of `blocking::spi::WriteIter<W>` for implementers of
8482
/// `spi::FullDuplex<W>`

src/digital.rs

-9
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ pub trait OutputPin {
1919
}
2020

2121
/// Push-pull output pin that can read its output state
22-
///
23-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
24-
#[cfg(feature = "unproven")]
2522
pub trait StatefulOutputPin: OutputPin {
2623
/// Is the pin in drive high mode?
2724
///
@@ -36,13 +33,10 @@ pub trait StatefulOutputPin: OutputPin {
3633

3734
/// Output pin that can be toggled
3835
///
39-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
40-
///
4136
/// See [toggleable](toggleable) to use a software implementation if
4237
/// both [OutputPin](trait.OutputPin.html) and
4338
/// [StatefulOutputPin](trait.StatefulOutputPin.html) are
4439
/// implemented. Otherwise, implement this using hardware mechanisms.
45-
#[cfg(feature = "unproven")]
4640
pub trait ToggleableOutputPin {
4741
/// Error type
4842
type Error;
@@ -95,13 +89,10 @@ pub trait ToggleableOutputPin {
9589
/// pin.try_toggle().unwrap();
9690
/// assert!(pin.try_is_set_low().unwrap());
9791
/// ```
98-
#[cfg(feature = "unproven")]
9992
pub mod toggleable {
10093
use super::{OutputPin, StatefulOutputPin, ToggleableOutputPin};
10194

10295
/// Software-driven `toggle()` implementation.
103-
///
104-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
10596
pub trait Default: OutputPin + StatefulOutputPin {}
10697

10798
impl<P> ToggleableOutputPin for P

src/lib.rs

+9-25
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
//!
33
//! **NOTE** This HAL is still is active development. Expect the traits presented here to be
44
//! tweaked, split or be replaced wholesale before being stabilized, i.e. before hitting the 1.0.0
5-
//! release. That being said there's a part of the HAL that's currently considered unproven and is
6-
//! hidden behind an "unproven" Cargo feature. This API is even more volatile and it's exempt from
7-
//! semver rules: it can change in a non-backward compatible fashion or even disappear in between
8-
//! patch releases.
5+
//! release.
96
//!
107
//! # Design goals
118
//!
@@ -702,8 +699,6 @@ pub mod watchdog;
702699

703700
/// Input capture
704701
///
705-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
706-
///
707702
/// # Examples
708703
///
709704
/// You can use this interface to measure the period of (quasi) periodic signals
@@ -742,17 +737,15 @@ pub mod watchdog;
742737
/// # type Error = Infallible;
743738
/// # type Capture = u16;
744739
/// # type Channel = Channel;
745-
/// # type Error = Infallible;
746740
/// # type Time = MilliSeconds;
747741
/// # fn try_capture(&mut self, _: Channel) -> ::nb::Result<u16, Self::Error> { Ok(0) }
748742
/// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
749743
/// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
750744
/// # fn try_get_resolution(&self) -> Result<MilliSeconds, Self::Error> { unimplemented!() }
751-
/// # fn try_set_resolution<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<MilliSeconds> {}
745+
/// # fn try_set_resolution<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<MilliSeconds> { Ok(()) }
752746
/// # }
753747
/// ```
754-
#[cfg(feature = "unproven")]
755-
// reason: pre-singletons API. With singletons a `CapturePin` (cf. `PwmPin`) trait seems more
748+
// unproven reason: pre-singletons API. With singletons a `CapturePin` (cf. `PwmPin`) trait seems more
756749
// appropriate
757750
pub trait Capture {
758751
/// Enumeration of `Capture` errors
@@ -799,8 +792,6 @@ pub trait Capture {
799792

800793
/// Pulse Width Modulation
801794
///
802-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
803-
///
804795
/// # Examples
805796
///
806797
/// Use this interface to control the power output of some actuator
@@ -841,14 +832,13 @@ pub trait Capture {
841832
/// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
842833
/// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
843834
/// # fn try_get_duty(&self, _: Channel) -> Result<u16, Self::Error> { unimplemented!() }
844-
/// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { 0 }
845-
/// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> {}
835+
/// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { Ok(0) }
836+
/// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> { Ok(()) }
846837
/// # fn try_get_period(&self) -> Result<KiloHertz, Self::Error> { unimplemented!() }
847-
/// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> {}
838+
/// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> { Ok(()) }
848839
/// # }
849840
/// ```
850-
#[cfg(feature = "unproven")]
851-
// reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent
841+
// unproven reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent
852842
// PWM channels. Here a certain number of channels are multiplexed in a single implementer.
853843
pub trait Pwm {
854844
/// Enumeration of `Pwm` errors
@@ -925,8 +915,6 @@ pub trait PwmPin {
925915

926916
/// Quadrature encoder interface
927917
///
928-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
929-
///
930918
/// # Examples
931919
///
932920
/// You can use this interface to measure the speed of a motor
@@ -971,13 +959,13 @@ pub trait PwmPin {
971959
/// # }
972960
/// # struct Timer6;
973961
/// # impl hal::timer::CountDown for Timer6 {
962+
/// # type Error = Infallible;
974963
/// # type Time = Seconds;
975964
/// # fn try_start<T>(&mut self, _: T) -> Result<(), Infallible> where T: Into<Seconds> { Ok(()) }
976965
/// # fn try_wait(&mut self) -> ::nb::Result<(), Infallible> { Ok(()) }
977966
/// # }
978967
/// ```
979-
#[cfg(feature = "unproven")]
980-
// reason: needs to be re-evaluated in the new singletons world. At the very least this needs a
968+
// unproven reason: needs to be re-evaluated in the new singletons world. At the very least this needs a
981969
// reference implementation
982970
pub trait Qei {
983971
/// Enumeration of `Qei` errors
@@ -994,11 +982,7 @@ pub trait Qei {
994982
}
995983

996984
/// Count direction
997-
///
998-
/// *This enumeration is available if embedded-hal is built with the `"unproven"` feature.*
999985
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
1000-
#[cfg(feature = "unproven")]
1001-
// reason: part of the unproven `Qei` interface
1002986
pub enum Direction {
1003987
/// 3, 2, 1
1004988
Downcounting,

src/prelude.rs

-14
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,30 @@
33
//! The traits have been renamed to avoid collisions with other items when
44
//! performing a glob import.
55
6-
#[cfg(feature = "unproven")]
76
pub use crate::adc::OneShot as _embedded_hal_adc_OneShot;
87
pub use crate::blocking::delay::DelayMs as _embedded_hal_blocking_delay_DelayMs;
98
pub use crate::blocking::delay::DelayUs as _embedded_hal_blocking_delay_DelayUs;
109
pub use crate::blocking::i2c::{
1110
Read as _embedded_hal_blocking_i2c_Read, Write as _embedded_hal_blocking_i2c_Write,
1211
WriteRead as _embedded_hal_blocking_i2c_WriteRead,
1312
};
14-
#[cfg(feature = "unproven")]
1513
pub use crate::blocking::rng::Read as _embedded_hal_blocking_rng_Read;
1614
pub use crate::blocking::serial::Write as _embedded_hal_blocking_serial_Write;
1715
pub use crate::blocking::spi::{
1816
Transfer as _embedded_hal_blocking_spi_Transfer, Write as _embedded_hal_blocking_spi_Write,
1917
};
20-
#[allow(deprecated)]
21-
#[cfg(feature = "unproven")]
2218
pub use crate::digital::InputPin as _embedded_hal_digital_InputPin;
23-
#[allow(deprecated)]
2419
pub use crate::digital::OutputPin as _embedded_hal_digital_OutputPin;
25-
#[cfg(feature = "unproven")]
26-
#[allow(deprecated)]
2720
pub use crate::digital::ToggleableOutputPin as _embedded_hal_digital_ToggleableOutputPin;
28-
#[cfg(feature = "unproven")]
2921
pub use crate::rng::Read as _embedded_hal_rng_Read;
3022
pub use crate::serial::Read as _embedded_hal_serial_Read;
3123
pub use crate::serial::Write as _embedded_hal_serial_Write;
3224
pub use crate::spi::FullDuplex as _embedded_hal_spi_FullDuplex;
3325
pub use crate::timer::CountDown as _embedded_hal_timer_CountDown;
34-
#[cfg(feature = "unproven")]
3526
pub use crate::watchdog::Watchdog as _embedded_hal_watchdog_Watchdog;
36-
#[cfg(feature = "unproven")]
3727
pub use crate::watchdog::WatchdogDisable as _embedded_hal_watchdog_WatchdogDisable;
38-
#[cfg(feature = "unproven")]
3928
pub use crate::watchdog::WatchdogEnable as _embedded_hal_watchdog_WatchdogEnable;
40-
#[cfg(feature = "unproven")]
4129
pub use crate::Capture as _embedded_hal_Capture;
42-
#[cfg(feature = "unproven")]
4330
pub use crate::Pwm as _embedded_hal_Pwm;
4431
pub use crate::PwmPin as _embedded_hal_PwmPin;
45-
#[cfg(feature = "unproven")]
4632
pub use crate::Qei as _embedded_hal_Qei;

src/rng.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
//! Random Number Generator Interface
22
3-
#[cfg(feature = "unproven")]
43
use nb;
54

65
/// Nonblocking stream of random bytes.
7-
#[cfg(feature = "unproven")]
8-
// reason: No implementation or users yet
96
pub trait Read {
107
/// An enumeration of RNG errors.
118
///

src/watchdog.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
/// Feeds an existing watchdog to ensure the processor isn't reset. Sometimes
44
/// commonly referred to as "kicking" or "refreshing".
5-
#[cfg(feature = "unproven")]
65
pub trait Watchdog {
76
/// An enumeration of `Watchdog` errors.
87
///
@@ -16,7 +15,6 @@ pub trait Watchdog {
1615

1716
/// Enables A watchdog timer to reset the processor if software is frozen or
1817
/// stalled.
19-
#[cfg(feature = "unproven")]
2018
pub trait WatchdogEnable {
2119
/// An enumeration of `WatchdogEnable` errors.
2220
///
@@ -34,7 +32,6 @@ pub trait WatchdogEnable {
3432
}
3533

3634
/// Disables a running watchdog timer so the processor won't be reset.
37-
#[cfg(feature = "unproven")]
3835
pub trait WatchdogDisable {
3936
/// An enumeration of `WatchdogDisable` errors.
4037
///

0 commit comments

Comments
 (0)