aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias <[email protected]>2022-09-09 12:45:03 +0200
committerMathias <[email protected]>2022-09-16 12:54:26 +0200
commitf7267d493fe9ed63b02f82267d29a10a4b1cf515 (patch)
treecbe3ae2ff159ada5df38c1f16d788277f43c0c35
parent9794bc59cc74598f5131f502153d4288c3261274 (diff)
Feature-gate time-driver in embassy-rp
-rwxr-xr-xci.sh2
-rw-r--r--embassy-rp/Cargo.toml2
-rw-r--r--embassy-rp/src/lib.rs2
-rw-r--r--examples/rp/Cargo.toml2
4 files changed, 6 insertions, 2 deletions
diff --git a/ci.sh b/ci.sh
index fa24d5268..ae1b44281 100755
--- a/ci.sh
+++ b/ci.sh
@@ -120,7 +120,7 @@ cargo batch \
120 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --out-dir out/tests/nucleo-stm32h755zi \ 120 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --out-dir out/tests/nucleo-stm32h755zi \
121 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --out-dir out/tests/nucleo-stm32wb55rg \ 121 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --out-dir out/tests/nucleo-stm32wb55rg \
122 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/iot-stm32u585ai \ 122 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/iot-stm32u585ai \
123 --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \ 123 --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --features embassy-rp/time-driver --out-dir out/tests/rpi-pico \
124 $BUILD_EXTRA 124 $BUILD_EXTRA
125 125
126 126
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index ccb2f6525..1e26f7dd2 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -20,6 +20,8 @@ defmt = ["dep:defmt", "embassy-usb?/defmt"]
20# There are no plans to make this stable. 20# There are no plans to make this stable.
21unstable-pac = [] 21unstable-pac = []
22 22
23time-driver = []
24
23# Enable nightly-only features 25# Enable nightly-only features
24nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb"] 26nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb"]
25 27
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs
index aebbbf567..8dcefece2 100644
--- a/embassy-rp/src/lib.rs
+++ b/embassy-rp/src/lib.rs
@@ -8,6 +8,7 @@ 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")]
11pub mod timer; 12pub mod timer;
12pub mod uart; 13pub mod uart;
13#[cfg(feature = "nightly")] 14#[cfg(feature = "nightly")]
@@ -108,6 +109,7 @@ pub fn init(_config: config::Config) -> Peripherals {
108 109
109 unsafe { 110 unsafe {
110 clocks::init(); 111 clocks::init();
112 #[cfg(feature = "time-driver")]
111 timer::init(); 113 timer::init();
112 dma::init(); 114 dma::init();
113 } 115 }
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml
index 18a92b094..17393322c 100644
--- a/examples/rp/Cargo.toml
+++ b/examples/rp/Cargo.toml
@@ -8,7 +8,7 @@ version = "0.1.0"
8embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } 8embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] }
9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } 9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] }
10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } 10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] }
11embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } 11embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] }
12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
13embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } 13embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] }
14embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } 14embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] }