aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias <[email protected]>2022-09-09 12:28:35 +0200
committerMathias <[email protected]>2022-09-16 13:23:52 +0200
commitc495c765df42ca273da55b320c869b0aaabc6ef8 (patch)
tree19a92332c0561f76b6b1f4faad0cee796c6875c7
parentb2d0f8d5903f868277732b4b12365945783d1720 (diff)
Enable embedded-io on nightly
-rw-r--r--embassy-rp/Cargo.toml44
-rw-r--r--embassy-rp/src/lib.rs2
2 files changed, 14 insertions, 32 deletions
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index 92780ee39..3debca710 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -7,7 +7,9 @@ edition = "2021"
7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-rp-v$VERSION/embassy-rp/src/" 7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-rp-v$VERSION/embassy-rp/src/"
8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-rp/src/" 8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-rp/src/"
9features = ["nightly", "defmt", "unstable-pac", "unstable-traits"] 9features = ["nightly", "defmt", "unstable-pac", "unstable-traits"]
10flavors = [{ name = "rp2040", target = "thumbv6m-none-eabi" }] 10flavors = [
11 { name = "rp2040", target = "thumbv6m-none-eabi" },
12]
11 13
12[features] 14[features]
13defmt = ["dep:defmt", "embassy-usb?/defmt"] 15defmt = ["dep:defmt", "embassy-usb?/defmt"]
@@ -18,16 +20,8 @@ defmt = ["dep:defmt", "embassy-usb?/defmt"]
18# There are no plans to make this stable. 20# There are no plans to make this stable.
19unstable-pac = [] 21unstable-pac = []
20 22
21time-driver = []
22
23# Enable nightly-only features 23# Enable nightly-only features
24nightly = [ 24nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb", "dep:embedded-io"]
25 "embassy-executor/nightly",
26 "embedded-hal-1",
27 "embedded-hal-async",
28 "embassy-embedded-hal/nightly",
29 "dep:embassy-usb",
30]
31 25
32# Implement embedded-hal 1.0 alpha traits. 26# Implement embedded-hal 1.0 alpha traits.
33# Implement embedded-hal-async traits if `nightly` is set as well. 27# Implement embedded-hal-async traits if `nightly` is set as well.
@@ -36,15 +30,11 @@ unstable-traits = ["embedded-hal-1"]
36[dependencies] 30[dependencies]
37embassy-sync = { version = "0.1.0", path = "../embassy-sync" } 31embassy-sync = { version = "0.1.0", path = "../embassy-sync" }
38embassy-executor = { version = "0.1.0", path = "../embassy-executor" } 32embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
39embassy-time = { version = "0.1.0", path = "../embassy-time", features = [ 33embassy-time = { version = "0.1.0", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] }
40 "tick-hz-1_000_000", 34embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-2"]}
41] } 35embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
42embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = [ 36embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
43 "prio-bits-2", 37embassy-usb = {version = "0.1.0", path = "../embassy-usb", optional = true }
44] }
45embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common" }
46embassy-embedded-hal = { version = "0.1.0", path = "../embassy-embedded-hal" }
47embassy-usb = { version = "0.1.0", path = "../embassy-usb", optional = true }
48atomic-polyfill = "1.0.1" 38atomic-polyfill = "1.0.1"
49defmt = { version = "0.3", optional = true } 39defmt = { version = "0.3", optional = true }
50log = { version = "0.4.14", optional = true } 40log = { version = "0.4.14", optional = true }
@@ -53,18 +43,12 @@ cfg-if = "1.0.0"
53cortex-m-rt = ">=0.6.15,<0.8" 43cortex-m-rt = ">=0.6.15,<0.8"
54cortex-m = "0.7.6" 44cortex-m = "0.7.6"
55critical-section = "1.1" 45critical-section = "1.1"
56futures = { version = "0.3.17", default-features = false, features = [ 46futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
57 "async-await",
58] }
59embedded-io = { version = "0.3.0", features = ["async"], optional = true } 47embedded-io = { version = "0.3.0", features = ["async"], optional = true }
60 48
61rp2040-pac2 = { git = "https://github.com/embassy-rs/rp2040-pac2", rev = "017e3c9007b2d3b6965f0d85b5bf8ce3fa6d7364", features = [ 49rp2040-pac2 = { git = "https://github.com/embassy-rs/rp2040-pac2", rev="017e3c9007b2d3b6965f0d85b5bf8ce3fa6d7364", features = ["rt"] }
62 "rt",
63] }
64#rp2040-pac2 = { path = "../../rp2040-pac2", features = ["rt"] } 50#rp2040-pac2 = { path = "../../rp2040-pac2", features = ["rt"] }
65 51
66embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ 52embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] }
67 "unproven", 53embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true}
68] } 54embedded-hal-async = { version = "0.1.0-alpha.1", optional = true}
69embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true }
70embedded-hal-async = { version = "0.1.0-alpha.1", optional = true }
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs
index 8dcefece2..aebbbf567 100644
--- a/embassy-rp/src/lib.rs
+++ b/embassy-rp/src/lib.rs
@@ -8,7 +8,6 @@ pub mod dma;
8pub mod gpio; 8pub mod gpio;
9pub mod interrupt; 9pub mod interrupt;
10pub mod spi; 10pub mod spi;
11#[cfg(feature = "time-driver")]
12pub mod timer; 11pub mod timer;
13pub mod uart; 12pub mod uart;
14#[cfg(feature = "nightly")] 13#[cfg(feature = "nightly")]
@@ -109,7 +108,6 @@ pub fn init(_config: config::Config) -> Peripherals {
109 108
110 unsafe { 109 unsafe {
111 clocks::init(); 110 clocks::init();
112 #[cfg(feature = "time-driver")]
113 timer::init(); 111 timer::init();
114 dma::init(); 112 dma::init();
115 } 113 }