diff options
| author | Mathias <[email protected]> | 2022-09-09 12:45:03 +0200 |
|---|---|---|
| committer | Mathias <[email protected]> | 2022-09-16 12:54:26 +0200 |
| commit | f7267d493fe9ed63b02f82267d29a10a4b1cf515 (patch) | |
| tree | cbe3ae2ff159ada5df38c1f16d788277f43c0c35 | |
| parent | 9794bc59cc74598f5131f502153d4288c3261274 (diff) | |
Feature-gate time-driver in embassy-rp
| -rwxr-xr-x | ci.sh | 2 | ||||
| -rw-r--r-- | embassy-rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-rp/src/lib.rs | 2 | ||||
| -rw-r--r-- | examples/rp/Cargo.toml | 2 |
4 files changed, 6 insertions, 2 deletions
| @@ -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. |
| 21 | unstable-pac = [] | 21 | unstable-pac = [] |
| 22 | 22 | ||
| 23 | time-driver = [] | ||
| 24 | |||
| 23 | # Enable nightly-only features | 25 | # Enable nightly-only features |
| 24 | nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb"] | 26 | nightly = ["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; | |||
| 8 | pub mod gpio; | 8 | pub mod gpio; |
| 9 | pub mod interrupt; | 9 | pub mod interrupt; |
| 10 | pub mod spi; | 10 | pub mod spi; |
| 11 | #[cfg(feature = "time-driver")] | ||
| 11 | pub mod timer; | 12 | pub mod timer; |
| 12 | pub mod uart; | 13 | pub 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" | |||
| 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } | 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 13 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 13 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } |
| 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
