diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-11-29 17:23:48 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-11-29 17:26:33 +0100 |
| commit | c6989dfbca51787146f50270c671af9db434f577 (patch) | |
| tree | 5974a8ec41c108d5208e4f68027b918d424a2046 | |
| parent | 384bad7bfaa1f2415baf2cd3b69ebf36dc0a02d7 (diff) | |
Remove nightly and unstable-traits features in preparation for 1.75.
127 files changed, 1727 insertions, 2108 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..c1ab9a9b9 --- /dev/null +++ b/.cargo/config.toml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [patch.crates-io] | ||
| 2 | embedded-storage = { git = "https://github.com/rust-embedded-community/embedded-storage", rev = "634302740f8d676538c3890748e7d7dfe372a040" } | ||
| 3 | embedded-storage-async = { git = "https://github.com/rust-embedded-community/embedded-storage", rev = "634302740f8d676538c3890748e7d7dfe372a040" } \ No newline at end of file | ||
diff --git a/.github/ci/build-stable.sh b/.github/ci/build-stable.sh index ffaebeb35..9160a2be2 100755 --- a/.github/ci/build-stable.sh +++ b/.github/ci/build-stable.sh | |||
| @@ -21,7 +21,7 @@ fi | |||
| 21 | hashtime restore /ci/cache/filetime.json || true | 21 | hashtime restore /ci/cache/filetime.json || true |
| 22 | hashtime save /ci/cache/filetime.json | 22 | hashtime save /ci/cache/filetime.json |
| 23 | 23 | ||
| 24 | sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml | 24 | sed -i 's/channel.*/channel = "beta"/g' rust-toolchain.toml |
| 25 | 25 | ||
| 26 | ./ci_stable.sh | 26 | ./ci_stable.sh |
| 27 | 27 | ||
diff --git a/.github/ci/test.sh b/.github/ci/test.sh index dfc2b08ce..1ee760d31 100755 --- a/.github/ci/test.sh +++ b/.github/ci/test.sh | |||
| @@ -4,17 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | set -euo pipefail | 5 | set -euo pipefail |
| 6 | 6 | ||
| 7 | export RUSTUP_HOME=/ci/cache/rustup | ||
| 8 | export CARGO_HOME=/ci/cache/cargo | ||
| 9 | export CARGO_TARGET_DIR=/ci/cache/target | ||
| 10 | |||
| 11 | # needed for "dumb HTTP" transport support | ||
| 12 | # used when pointing stm32-metapac to a CI-built one. | ||
| 13 | export CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
| 14 | |||
| 15 | hashtime restore /ci/cache/filetime.json || true | ||
| 16 | hashtime save /ci/cache/filetime.json | ||
| 17 | |||
| 18 | MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --manifest-path ./embassy-executor/Cargo.toml | 7 | MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --manifest-path ./embassy-executor/Cargo.toml |
| 19 | MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --manifest-path ./embassy-executor/Cargo.toml --features nightly | 8 | MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --manifest-path ./embassy-executor/Cargo.toml --features nightly |
| 20 | 9 | ||
| @@ -24,16 +13,15 @@ cargo test --manifest-path ./embassy-hal-internal/Cargo.toml | |||
| 24 | cargo test --manifest-path ./embassy-time/Cargo.toml --features generic-queue | 13 | cargo test --manifest-path ./embassy-time/Cargo.toml --features generic-queue |
| 25 | 14 | ||
| 26 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml | 15 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml |
| 27 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly | 16 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features ed25519-dalek |
| 28 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-dalek | 17 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features ed25519-salty |
| 29 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-salty | ||
| 30 | 18 | ||
| 31 | cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nightly,nrf52840,time-driver-rtc1,gpiote | 19 | cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nrf52840,time-driver-rtc1,gpiote |
| 32 | 20 | ||
| 33 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features nightly,time-driver | 21 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features time-driver |
| 34 | 22 | ||
| 35 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f429vg,exti,time-driver-any,exti | 23 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f429vg,exti,time-driver-any,exti |
| 36 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f732ze,exti,time-driver-any,exti | 24 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f732ze,exti,time-driver-any,exti |
| 37 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f769ni,exti,time-driver-any,exti | 25 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f769ni,exti,time-driver-any,exti |
| 38 | 26 | ||
| 39 | cargo test --manifest-path ./embassy-net-adin1110/Cargo.toml | 27 | cargo test --manifest-path ./embassy-net-adin1110/Cargo.toml |
| @@ -35,104 +35,94 @@ cargo batch \ | |||
| 35 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,integrated-timers \ | 35 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,integrated-timers \ |
| 36 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,executor-thread \ | 36 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,executor-thread \ |
| 37 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,executor-thread,integrated-timers \ | 37 | --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features nightly,arch-riscv32,executor-thread,integrated-timers \ |
| 38 | --- build --release --manifest-path embassy-sync/Cargo.toml --target thumbv6m-none-eabi --features nightly,defmt \ | 38 | --- build --release --manifest-path embassy-sync/Cargo.toml --target thumbv6m-none-eabi --features defmt \ |
| 39 | --- build --release --manifest-path embassy-time/Cargo.toml --target thumbv6m-none-eabi --features nightly,defmt,defmt-timestamp-uptime,tick-hz-32_768,generic-queue-8 \ | 39 | --- build --release --manifest-path embassy-time/Cargo.toml --target thumbv6m-none-eabi --features defmt,defmt-timestamp-uptime,tick-hz-32_768,generic-queue-8 \ |
| 40 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,medium-ethernet \ | 40 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,medium-ethernet \ |
| 41 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,igmp,medium-ethernet \ | 41 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,igmp,medium-ethernet \ |
| 42 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet \ | 42 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet \ |
| 43 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet,nightly,dhcpv4-hostname \ | 43 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet,dhcpv4-hostname \ |
| 44 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ | 44 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ |
| 45 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ieee802154 \ | 45 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ieee802154 \ |
| 46 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet,medium-ieee802154 \ | 46 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet,medium-ieee802154 \ |
| 47 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet,nightly \ | 47 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ |
| 48 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ethernet \ | 48 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ethernet \ |
| 49 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ethernet,nightly \ | 49 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip \ |
| 50 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,nightly \ | 50 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet \ |
| 51 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet,nightly \ | 51 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet,medium-ieee802154 \ |
| 52 | --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet,medium-ieee802154,nightly \ | 52 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805,gpiote,time-driver-rtc1 \ |
| 53 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52805,gpiote,time-driver-rtc1 \ | 53 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810,gpiote,time-driver-rtc1 \ |
| 54 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52810,gpiote,time-driver-rtc1 \ | 54 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ |
| 55 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52811,gpiote,time-driver-rtc1 \ | 55 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time-driver-rtc1 \ |
| 56 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52820,gpiote,time-driver-rtc1 \ | 56 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time-driver-rtc1,reset-pin-as-gpio \ |
| 57 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52832,gpiote,time-driver-rtc1,reset-pin-as-gpio \ | 57 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time-driver-rtc1,nfc-pins-as-gpio \ |
| 58 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52833,gpiote,time-driver-rtc1,unstable-traits,nfc-pins-as-gpio \ | 58 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time-driver-rtc1 \ |
| 59 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,nrf9160-s,gpiote,time-driver-rtc1 \ | 59 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time-driver-rtc1 \ |
| 60 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,nrf9160-ns,gpiote,time-driver-rtc1,unstable-traits \ | 60 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time-driver-rtc1 \ |
| 61 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,nrf5340-app-s,gpiote,time-driver-rtc1,unstable-traits \ | 61 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time-driver-rtc1 \ |
| 62 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,nrf5340-app-ns,gpiote,time-driver-rtc1 \ | 62 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time-driver-rtc1 \ |
| 63 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,nrf5340-net,gpiote,time-driver-rtc1,unstable-traits \ | 63 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ |
| 64 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,gpiote,time-driver-rtc1 \ | 64 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ |
| 65 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,log,gpiote,time-driver-rtc1 \ | 65 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1 \ |
| 66 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ | 66 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features defmt \ |
| 67 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,defmt \ | 67 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features log \ |
| 68 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \ | 68 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features intrinsics \ |
| 69 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ | 69 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features qspi-as-gpio \ |
| 70 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ | 70 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,time \ |
| 71 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \ | 71 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any,time \ |
| 72 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,qspi-as-gpio \ | 72 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time \ |
| 73 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,unstable-traits,time \ | 73 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time \ |
| 74 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,time \ | 74 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,time \ |
| 75 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any,time \ | 75 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any,time \ |
| 76 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any,unstable-traits,time \ | ||
| 77 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time \ | 76 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time \ |
| 78 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,unstable-traits,time \ | ||
| 79 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time \ | 77 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time \ |
| 80 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,time-driver-any,unstable-traits,time \ | 78 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti \ |
| 81 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,time-driver-any,time \ | 79 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt \ |
| 82 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,time-driver-any,time \ | 80 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any \ |
| 83 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,time-driver-any,unstable-traits,time \ | 81 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any \ |
| 84 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,time \ | 82 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any \ |
| 85 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,unstable-traits,time \ | 83 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any,time \ |
| 86 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,time \ | 84 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any,time \ |
| 87 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti \ | 85 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any,time \ |
| 88 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,unstable-traits \ | 86 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ |
| 89 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt \ | 87 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,exti,time-driver-any,time \ |
| 90 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f401ve,defmt,exti,time-driver-any,unstable-traits \ | 88 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f412zg,defmt,exti,time-driver-any,time \ |
| 91 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f405zg,defmt,exti,time-driver-any,unstable-traits \ | 89 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f413vh,defmt,exti,time-driver-any,time \ |
| 92 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f407zg,defmt,exti,time-driver-any,unstable-traits \ | 90 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f415zg,defmt,exti,time-driver-any,time \ |
| 93 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f401ve,defmt,exti,time-driver-any,unstable-traits,time \ | 91 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ |
| 94 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f405zg,defmt,exti,time-driver-any,unstable-traits,time \ | 92 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ |
| 95 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f407zg,defmt,exti,time-driver-any,unstable-traits,time \ | 93 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ |
| 96 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits,time \ | 94 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embedded-sdmmc,time \ |
| 97 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits,time \ | 95 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ |
| 98 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f412zg,defmt,exti,time-driver-any,unstable-traits,time \ | 96 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ |
| 99 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f413vh,defmt,exti,time-driver-any,unstable-traits,time \ | 97 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ |
| 100 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f415zg,defmt,exti,time-driver-any,unstable-traits,time \ | 98 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ |
| 101 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f417zg,defmt,exti,time-driver-any,unstable-traits,time \ | 99 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,embedded-sdmmc,time \ |
| 102 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f423zh,defmt,exti,time-driver-any,unstable-traits,time \ | 100 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ |
| 103 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f427zi,defmt,exti,time-driver-any,unstable-traits,time \ | 101 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ |
| 104 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,unstable-traits,embedded-sdmmc,time \ | 102 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ |
| 105 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f437zi,log,exti,time-driver-any,unstable-traits,time \ | 103 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time \ |
| 106 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f439zi,defmt,exti,time-driver-any,unstable-traits,time \ | 104 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h725re,defmt,exti,time-driver-any,time \ |
| 107 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f446ze,defmt,exti,time-driver-any,unstable-traits,time \ | 105 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7b3ai,defmt,exti,time-driver-any,time \ |
| 108 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f469zi,defmt,exti,time-driver-any,unstable-traits,time \ | 106 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ |
| 109 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f479zi,defmt,exti,time-driver-any,unstable-traits,embedded-sdmmc,time \ | 107 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l422cb,defmt,exti,time-driver-any,time \ |
| 110 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f730i8,defmt,exti,time-driver-any,unstable-traits,time \ | 108 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb15cc,defmt,exti,time-driver-any,time \ |
| 111 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h753zi,defmt,exti,time-driver-any,unstable-traits,time \ | 109 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ |
| 112 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h735zg,defmt,exti,time-driver-any,unstable-traits,time \ | 110 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l041f6,defmt,exti,time-driver-any,time \ |
| 113 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h755zi-cm7,defmt,exti,time-driver-any,unstable-traits,time \ | 111 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l073cz,defmt,exti,time-driver-any,low-power,time \ |
| 114 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h725re,defmt,exti,time-driver-any,unstable-traits,time \ | 112 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ |
| 115 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h7b3ai,defmt,exti,time-driver-any,unstable-traits,time \ | 113 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f398ve,defmt,exti,time-driver-any,time \ |
| 116 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32l476vg,defmt,exti,time-driver-any,unstable-traits,time \ | 114 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f378cc,defmt,exti,time-driver-any,time \ |
| 117 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32l422cb,defmt,exti,time-driver-any,unstable-traits,time \ | 115 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g0c1ve,defmt,exti,time-driver-any,time \ |
| 118 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wb15cc,defmt,exti,time-driver-any,unstable-traits,time \ | 116 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ |
| 119 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l072cz,defmt,exti,time-driver-any,unstable-traits,time \ | 117 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,time \ |
| 120 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l041f6,defmt,exti,time-driver-any,unstable-traits,time \ | 118 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32wl54jc-cm0p,defmt,exti,time-driver-any,time \ |
| 121 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l073cz,defmt,exti,time-driver-any,unstable-traits,low-power,time \ | 119 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wle5jb,defmt,exti,time-driver-any,time \ |
| 122 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32l151cb-a,defmt,exti,time-driver-any,unstable-traits,time \ | 120 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g474pe,defmt,exti,time-driver-any,time \ |
| 123 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f398ve,defmt,exti,time-driver-any,unstable-traits,time \ | 121 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f107vc,defmt,exti,time-driver-any,time \ |
| 124 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f378cc,defmt,exti,time-driver-any,unstable-traits,time \ | 122 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103re,defmt,exti,time-driver-any,time \ |
| 125 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32g0c1ve,defmt,exti,time-driver-any,unstable-traits,time \ | 123 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f100c4,defmt,exti,time-driver-any,time \ |
| 126 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f217zg,defmt,exti,time-driver-any,unstable-traits,time \ | 124 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32h503rb,defmt,exti,time-driver-any,time \ |
| 127 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,unstable-traits,time \ | 125 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32h562ag,defmt,exti,time-driver-any,time \ |
| 128 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 129 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wle5jb,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 130 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32g474pe,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 131 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f107vc,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 132 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f103re,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 133 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f100c4,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 134 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32h503rb,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 135 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32h562ag,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 136 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ | 126 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ |
| 137 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ | 127 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ |
| 138 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ | 128 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ |
| @@ -140,10 +130,10 @@ cargo batch \ | |||
| 140 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs' \ | 130 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs' \ |
| 141 | --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features '' \ | 131 | --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features '' \ |
| 142 | --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'overclock' \ | 132 | --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'overclock' \ |
| 143 | --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840,nightly \ | 133 | --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ |
| 144 | --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns,nightly \ | 134 | --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \ |
| 145 | --- build --release --manifest-path embassy-boot/rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ | 135 | --- build --release --manifest-path embassy-boot/rp/Cargo.toml --target thumbv6m-none-eabi \ |
| 146 | --- build --release --manifest-path embassy-boot/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4,nightly \ | 136 | --- build --release --manifest-path embassy-boot/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \ |
| 147 | --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ | 137 | --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ |
| 148 | --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ | 138 | --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ |
| 149 | --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ | 139 | --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ |
diff --git a/ci_stable.sh b/ci_stable.sh index 1fe4e3a1e..66ed8f79d 100755 --- a/ci_stable.sh +++ b/ci_stable.sh | |||
| @@ -22,56 +22,56 @@ cargo batch \ | |||
| 22 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ | 22 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ |
| 23 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time-driver-rtc1 \ | 23 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time-driver-rtc1 \ |
| 24 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time-driver-rtc1 \ | 24 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time-driver-rtc1 \ |
| 25 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time-driver-rtc1,unstable-traits \ | 25 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time-driver-rtc1 \ |
| 26 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time-driver-rtc1 \ | 26 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time-driver-rtc1 \ |
| 27 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time-driver-rtc1,unstable-traits \ | 27 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time-driver-rtc1 \ |
| 28 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time-driver-rtc1,unstable-traits \ | 28 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time-driver-rtc1 \ |
| 29 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time-driver-rtc1 \ | 29 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time-driver-rtc1 \ |
| 30 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time-driver-rtc1,unstable-traits \ | 30 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time-driver-rtc1 \ |
| 31 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ | 31 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ |
| 32 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ | 32 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ |
| 33 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ | 33 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1 \ |
| 34 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \ | 34 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features defmt \ |
| 35 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \ | 35 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features log \ |
| 36 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \ | 36 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \ |
| 37 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features qspi-as-gpio \ | 37 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features qspi-as-gpio \ |
| 38 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,unstable-traits \ | 38 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any \ |
| 39 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,unstable-traits \ | 39 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any \ |
| 40 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,unstable-traits \ | 40 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any \ |
| 41 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any,unstable-traits \ | 41 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any \ |
| 42 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55cc-cm4,defmt,exti,time-driver-any,unstable-traits \ | 42 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55cc-cm4,defmt,exti,time-driver-any \ |
| 43 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,unstable-traits,time \ | 43 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,time \ |
| 44 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,unstable-traits,time \ | 44 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,time \ |
| 45 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,unstable-traits,time \ | 45 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,time \ |
| 46 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any,unstable-traits,time \ | 46 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any,time \ |
| 47 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55cc-cm4,defmt,exti,time-driver-any,unstable-traits,time \ | 47 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55cc-cm4,defmt,exti,time-driver-any,time \ |
| 48 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r9zi,defmt,exti,time-driver-any,unstable-traits,time \ | 48 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r9zi,defmt,exti,time-driver-any,time \ |
| 49 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303vc,defmt,exti,time-driver-any,unstable-traits,time \ | 49 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303vc,defmt,exti,time-driver-any,time \ |
| 50 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,time \ | 50 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,time \ |
| 51 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,unstable-traits,time \ | 51 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,time \ |
| 52 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,time \ | ||
| 52 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,time \ | 53 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,time \ |
| 53 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,unstable-traits,time \ | ||
| 54 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,time \ | 54 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,time \ |
| 55 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,unstable-traits,time \ | 55 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,time \ |
| 56 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,time \ | ||
| 56 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,time \ | 57 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,time \ |
| 57 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,unstable-traits,time \ | ||
| 58 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,time \ | 58 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,time \ |
| 59 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,unstable-traits,time \ | 59 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,time \ |
| 60 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,time \ | ||
| 60 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,time \ | 61 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,time \ |
| 61 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,unstable-traits,time \ | ||
| 62 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ | 62 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ |
| 63 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,unstable-traits,time \ | 63 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ |
| 64 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ | 64 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ |
| 65 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,unstable-traits,time \ | 65 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ |
| 66 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time \ | ||
| 66 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time \ | 67 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time \ |
| 67 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 68 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ | 68 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ |
| 69 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,unstable-traits,time \ | 69 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ |
| 70 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ | 70 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ |
| 71 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,unstable-traits,time \ | 71 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ |
| 72 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ | ||
| 72 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ | 73 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ |
| 73 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,unstable-traits,time \ | ||
| 74 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ | 74 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ |
| 75 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,unstable-traits,time \ | 75 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ |
| 76 | --- build --release --manifest-path examples/nrf52840/Cargo.toml --target thumbv7em-none-eabi --no-default-features --out-dir out/examples/nrf52840 --bin raw_spawn \ | 76 | --- build --release --manifest-path examples/nrf52840/Cargo.toml --target thumbv7em-none-eabi --no-default-features --out-dir out/examples/nrf52840 --bin raw_spawn \ |
| 77 | --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --no-default-features --out-dir out/examples/stm32l0 --bin raw_spawn \ | 77 | --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --no-default-features --out-dir out/examples/stm32l0 --bin raw_spawn \ |
diff --git a/cyw43-pio/src/lib.rs b/cyw43-pio/src/lib.rs index de89ed582..41b670324 100644 --- a/cyw43-pio/src/lib.rs +++ b/cyw43-pio/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![feature(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 4 | 3 | ||
| 5 | use core::slice; | 4 | use core::slice; |
| 6 | 5 | ||
diff --git a/cyw43/src/lib.rs b/cyw43/src/lib.rs index 4a1d015aa..300465e36 100644 --- a/cyw43/src/lib.rs +++ b/cyw43/src/lib.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(async_fn_in_trait, type_alias_impl_trait)] | 3 | #![allow(async_fn_in_trait)] |
| 4 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 5 | #![deny(unused_must_use)] | 4 | #![deny(unused_must_use)] |
| 6 | 5 | ||
| 7 | // This mod MUST go first, so that the others see its macros. | 6 | // This mod MUST go first, so that the others see its macros. |
diff --git a/docs/modules/ROOT/examples/basic/Cargo.toml b/docs/modules/ROOT/examples/basic/Cargo.toml index 527ce2eda..516dc4703 100644 --- a/docs/modules/ROOT/examples/basic/Cargo.toml +++ b/docs/modules/ROOT/examples/basic/Cargo.toml | |||
| @@ -6,9 +6,9 @@ version = "0.1.0" | |||
| 6 | license = "MIT OR Apache-2.0" | 6 | license = "MIT OR Apache-2.0" |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../../embassy-executor", features = ["defmt", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.1.4", path = "../../../../../embassy-time", features = ["defmt", "nightly"] } | 10 | embassy-time = { version = "0.1.4", path = "../../../../../embassy-time", features = ["defmt"] } |
| 11 | embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "nightly"] } | 11 | embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } |
| 12 | 12 | ||
| 13 | defmt = "0.3" | 13 | defmt = "0.3" |
| 14 | defmt-rtt = "0.3" | 14 | defmt-rtt = "0.3" |
diff --git a/embassy-boot/boot/Cargo.toml b/embassy-boot/boot/Cargo.toml index 8e11db570..ee69bc268 100644 --- a/embassy-boot/boot/Cargo.toml +++ b/embassy-boot/boot/Cargo.toml | |||
| @@ -25,12 +25,12 @@ features = ["defmt"] | |||
| 25 | [dependencies] | 25 | [dependencies] |
| 26 | defmt = { version = "0.3", optional = true } | 26 | defmt = { version = "0.3", optional = true } |
| 27 | digest = "0.10" | 27 | digest = "0.10" |
| 28 | log = { version = "0.4", optional = true } | 28 | log = { version = "0.4", optional = true } |
| 29 | ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true } | 29 | ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true } |
| 30 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 30 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 31 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync" } | 31 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync" } |
| 32 | embedded-storage = "0.3.0" | 32 | embedded-storage = "0.3.0" |
| 33 | embedded-storage-async = { version = "0.4.0", optional = true } | 33 | embedded-storage-async = { version = "0.4.0" } |
| 34 | salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true } | 34 | salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true } |
| 35 | signature = { version = "1.6.4", default-features = false } | 35 | signature = { version = "1.6.4", default-features = false } |
| 36 | 36 | ||
| @@ -50,7 +50,5 @@ features = ["rand", "std", "u32_backend"] | |||
| 50 | ed25519-dalek = ["dep:ed25519-dalek", "_verify"] | 50 | ed25519-dalek = ["dep:ed25519-dalek", "_verify"] |
| 51 | ed25519-salty = ["dep:salty", "_verify"] | 51 | ed25519-salty = ["dep:salty", "_verify"] |
| 52 | 52 | ||
| 53 | nightly = ["dep:embedded-storage-async", "embassy-embedded-hal/nightly"] | ||
| 54 | |||
| 55 | #Internal features | 53 | #Internal features |
| 56 | _verify = [] | 54 | _verify = [] |
diff --git a/embassy-boot/boot/src/firmware_updater/mod.rs b/embassy-boot/boot/src/firmware_updater/mod.rs index 937ddcc69..4814786bf 100644 --- a/embassy-boot/boot/src/firmware_updater/mod.rs +++ b/embassy-boot/boot/src/firmware_updater/mod.rs | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #[cfg(feature = "nightly")] | ||
| 2 | mod asynch; | 1 | mod asynch; |
| 3 | mod blocking; | 2 | mod blocking; |
| 4 | 3 | ||
| 5 | #[cfg(feature = "nightly")] | ||
| 6 | pub use asynch::{FirmwareState, FirmwareUpdater}; | 4 | pub use asynch::{FirmwareState, FirmwareUpdater}; |
| 7 | pub use blocking::{BlockingFirmwareState, BlockingFirmwareUpdater}; | 5 | pub use blocking::{BlockingFirmwareState, BlockingFirmwareUpdater}; |
| 8 | use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind}; | 6 | use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind}; |
diff --git a/embassy-boot/boot/src/lib.rs b/embassy-boot/boot/src/lib.rs index 9f0356375..9e70a4dca 100644 --- a/embassy-boot/boot/src/lib.rs +++ b/embassy-boot/boot/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait))] | ||
| 2 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | ||
| 3 | #![no_std] | 1 | #![no_std] |
| 2 | #![allow(async_fn_in_trait)] | ||
| 4 | #![warn(missing_docs)] | 3 | #![warn(missing_docs)] |
| 5 | #![doc = include_str!("../README.md")] | 4 | #![doc = include_str!("../README.md")] |
| 6 | mod fmt; | 5 | mod fmt; |
| @@ -18,10 +17,9 @@ mod test_flash; | |||
| 18 | pub(crate) const STATE_ERASE_VALUE: u8 = 0xFF; | 17 | pub(crate) const STATE_ERASE_VALUE: u8 = 0xFF; |
| 19 | pub use boot_loader::{BootError, BootLoader, BootLoaderConfig}; | 18 | pub use boot_loader::{BootError, BootLoader, BootLoaderConfig}; |
| 20 | pub use firmware_updater::{ | 19 | pub use firmware_updater::{ |
| 21 | BlockingFirmwareState, BlockingFirmwareUpdater, FirmwareUpdaterConfig, FirmwareUpdaterError, | 20 | BlockingFirmwareState, BlockingFirmwareUpdater, FirmwareState, FirmwareUpdater, FirmwareUpdaterConfig, |
| 21 | FirmwareUpdaterError, | ||
| 22 | }; | 22 | }; |
| 23 | #[cfg(feature = "nightly")] | ||
| 24 | pub use firmware_updater::{FirmwareState, FirmwareUpdater}; | ||
| 25 | 23 | ||
| 26 | pub(crate) const BOOT_MAGIC: u8 = 0xD0; | 24 | pub(crate) const BOOT_MAGIC: u8 = 0xD0; |
| 27 | pub(crate) const SWAP_MAGIC: u8 = 0xF0; | 25 | pub(crate) const SWAP_MAGIC: u8 = 0xF0; |
| @@ -57,7 +55,6 @@ mod tests { | |||
| 57 | #![allow(unused_imports)] | 55 | #![allow(unused_imports)] |
| 58 | 56 | ||
| 59 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 57 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 60 | #[cfg(feature = "nightly")] | ||
| 61 | use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; | 58 | use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; |
| 62 | use futures::executor::block_on; | 59 | use futures::executor::block_on; |
| 63 | 60 | ||
| @@ -65,9 +62,7 @@ mod tests { | |||
| 65 | use crate::boot_loader::BootLoaderConfig; | 62 | use crate::boot_loader::BootLoaderConfig; |
| 66 | use crate::firmware_updater::FirmwareUpdaterConfig; | 63 | use crate::firmware_updater::FirmwareUpdaterConfig; |
| 67 | use crate::mem_flash::MemFlash; | 64 | use crate::mem_flash::MemFlash; |
| 68 | #[cfg(feature = "nightly")] | 65 | use crate::test_flash::{AsyncTestFlash, BlockingTestFlash}; |
| 69 | use crate::test_flash::AsyncTestFlash; | ||
| 70 | use crate::test_flash::BlockingTestFlash; | ||
| 71 | 66 | ||
| 72 | /* | 67 | /* |
| 73 | #[test] | 68 | #[test] |
| @@ -105,7 +100,7 @@ mod tests { | |||
| 105 | } | 100 | } |
| 106 | 101 | ||
| 107 | #[test] | 102 | #[test] |
| 108 | #[cfg(all(feature = "nightly", not(feature = "_verify")))] | 103 | #[cfg(not(feature = "_verify"))] |
| 109 | fn test_swap_state() { | 104 | fn test_swap_state() { |
| 110 | const FIRMWARE_SIZE: usize = 57344; | 105 | const FIRMWARE_SIZE: usize = 57344; |
| 111 | let flash = AsyncTestFlash::new(BootLoaderConfig { | 106 | let flash = AsyncTestFlash::new(BootLoaderConfig { |
| @@ -183,7 +178,7 @@ mod tests { | |||
| 183 | } | 178 | } |
| 184 | 179 | ||
| 185 | #[test] | 180 | #[test] |
| 186 | #[cfg(all(feature = "nightly", not(feature = "_verify")))] | 181 | #[cfg(not(feature = "_verify"))] |
| 187 | fn test_swap_state_active_page_biggest() { | 182 | fn test_swap_state_active_page_biggest() { |
| 188 | const FIRMWARE_SIZE: usize = 12288; | 183 | const FIRMWARE_SIZE: usize = 12288; |
| 189 | let flash = AsyncTestFlash::new(BootLoaderConfig { | 184 | let flash = AsyncTestFlash::new(BootLoaderConfig { |
| @@ -228,7 +223,7 @@ mod tests { | |||
| 228 | } | 223 | } |
| 229 | 224 | ||
| 230 | #[test] | 225 | #[test] |
| 231 | #[cfg(all(feature = "nightly", not(feature = "_verify")))] | 226 | #[cfg(not(feature = "_verify"))] |
| 232 | fn test_swap_state_dfu_page_biggest() { | 227 | fn test_swap_state_dfu_page_biggest() { |
| 233 | const FIRMWARE_SIZE: usize = 12288; | 228 | const FIRMWARE_SIZE: usize = 12288; |
| 234 | let flash = AsyncTestFlash::new(BootLoaderConfig { | 229 | let flash = AsyncTestFlash::new(BootLoaderConfig { |
| @@ -272,7 +267,7 @@ mod tests { | |||
| 272 | } | 267 | } |
| 273 | 268 | ||
| 274 | #[test] | 269 | #[test] |
| 275 | #[cfg(all(feature = "nightly", feature = "_verify"))] | 270 | #[cfg(feature = "_verify")] |
| 276 | fn test_verify() { | 271 | fn test_verify() { |
| 277 | // The following key setup is based on: | 272 | // The following key setup is based on: |
| 278 | // https://docs.rs/ed25519-dalek/latest/ed25519_dalek/#example | 273 | // https://docs.rs/ed25519-dalek/latest/ed25519_dalek/#example |
diff --git a/embassy-boot/boot/src/mem_flash.rs b/embassy-boot/boot/src/mem_flash.rs index 2728e9720..40f352c8d 100644 --- a/embassy-boot/boot/src/mem_flash.rs +++ b/embassy-boot/boot/src/mem_flash.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | use core::ops::{Bound, Range, RangeBounds}; | 3 | use core::ops::{Bound, Range, RangeBounds}; |
| 4 | 4 | ||
| 5 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash}; | 5 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash}; |
| 6 | #[cfg(feature = "nightly")] | ||
| 7 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; | 6 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 8 | 7 | ||
| 9 | pub struct MemFlash<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> { | 8 | pub struct MemFlash<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> { |
| @@ -141,7 +140,6 @@ impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> NorFla | |||
| 141 | } | 140 | } |
| 142 | } | 141 | } |
| 143 | 142 | ||
| 144 | #[cfg(feature = "nightly")] | ||
| 145 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncReadNorFlash | 143 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncReadNorFlash |
| 146 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> | 144 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> |
| 147 | { | 145 | { |
| @@ -156,7 +154,6 @@ impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncR | |||
| 156 | } | 154 | } |
| 157 | } | 155 | } |
| 158 | 156 | ||
| 159 | #[cfg(feature = "nightly")] | ||
| 160 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncNorFlash | 157 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncNorFlash |
| 161 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> | 158 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> |
| 162 | { | 159 | { |
diff --git a/embassy-boot/boot/src/test_flash/blocking.rs b/embassy-boot/boot/src/test_flash/blocking.rs index ba33c9208..5ec476c65 100644 --- a/embassy-boot/boot/src/test_flash/blocking.rs +++ b/embassy-boot/boot/src/test_flash/blocking.rs | |||
| @@ -51,7 +51,6 @@ where | |||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | #[cfg(feature = "nightly")] | ||
| 55 | impl<ACTIVE, DFU, STATE> BlockingTestFlash<ACTIVE, DFU, STATE> | 54 | impl<ACTIVE, DFU, STATE> BlockingTestFlash<ACTIVE, DFU, STATE> |
| 56 | where | 55 | where |
| 57 | ACTIVE: NorFlash + embedded_storage_async::nor_flash::NorFlash, | 56 | ACTIVE: NorFlash + embedded_storage_async::nor_flash::NorFlash, |
diff --git a/embassy-boot/boot/src/test_flash/mod.rs b/embassy-boot/boot/src/test_flash/mod.rs index a0672322e..79b15a081 100644 --- a/embassy-boot/boot/src/test_flash/mod.rs +++ b/embassy-boot/boot/src/test_flash/mod.rs | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | #[cfg(feature = "nightly")] | ||
| 2 | mod asynch; | 1 | mod asynch; |
| 3 | mod blocking; | 2 | mod blocking; |
| 4 | 3 | ||
| 5 | #[cfg(feature = "nightly")] | ||
| 6 | pub(crate) use asynch::AsyncTestFlash; | 4 | pub(crate) use asynch::AsyncTestFlash; |
| 7 | pub(crate) use blocking::BlockingTestFlash; | 5 | pub(crate) use blocking::BlockingTestFlash; |
diff --git a/embassy-boot/nrf/Cargo.toml b/embassy-boot/nrf/Cargo.toml index 72c27efa8..b16506315 100644 --- a/embassy-boot/nrf/Cargo.toml +++ b/embassy-boot/nrf/Cargo.toml | |||
| @@ -22,7 +22,7 @@ embassy-boot = { path = "../boot", default-features = false } | |||
| 22 | cortex-m = { version = "0.7.6" } | 22 | cortex-m = { version = "0.7.6" } |
| 23 | cortex-m-rt = { version = "0.7" } | 23 | cortex-m-rt = { version = "0.7" } |
| 24 | embedded-storage = "0.3.0" | 24 | embedded-storage = "0.3.0" |
| 25 | embedded-storage-async = { version = "0.4.0", optional = true } | 25 | embedded-storage-async = { version = "0.4.0" } |
| 26 | cfg-if = "1.0.0" | 26 | cfg-if = "1.0.0" |
| 27 | 27 | ||
| 28 | nrf-softdevice-mbr = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice.git", branch = "master", optional = true } | 28 | nrf-softdevice-mbr = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice.git", branch = "master", optional = true } |
| @@ -36,8 +36,3 @@ defmt = [ | |||
| 36 | softdevice = [ | 36 | softdevice = [ |
| 37 | "nrf-softdevice-mbr", | 37 | "nrf-softdevice-mbr", |
| 38 | ] | 38 | ] |
| 39 | nightly = [ | ||
| 40 | "dep:embedded-storage-async", | ||
| 41 | "embassy-boot/nightly", | ||
| 42 | "embassy-nrf/nightly" | ||
| 43 | ] | ||
diff --git a/embassy-boot/nrf/src/lib.rs b/embassy-boot/nrf/src/lib.rs index b9d86eb17..5b20a93c6 100644 --- a/embassy-boot/nrf/src/lib.rs +++ b/embassy-boot/nrf/src/lib.rs | |||
| @@ -4,10 +4,9 @@ | |||
| 4 | mod fmt; | 4 | mod fmt; |
| 5 | 5 | ||
| 6 | pub use embassy_boot::{ | 6 | pub use embassy_boot::{ |
| 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareUpdaterConfig, | 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareState, FirmwareUpdater, |
| 8 | FirmwareUpdaterConfig, | ||
| 8 | }; | 9 | }; |
| 9 | #[cfg(feature = "nightly")] | ||
| 10 | pub use embassy_boot::{FirmwareState, FirmwareUpdater}; | ||
| 11 | use embassy_nrf::nvmc::PAGE_SIZE; | 10 | use embassy_nrf::nvmc::PAGE_SIZE; |
| 12 | use embassy_nrf::peripherals::WDT; | 11 | use embassy_nrf::peripherals::WDT; |
| 13 | use embassy_nrf::wdt; | 12 | use embassy_nrf::wdt; |
diff --git a/embassy-boot/rp/Cargo.toml b/embassy-boot/rp/Cargo.toml index efa0ef8ab..7329ea574 100644 --- a/embassy-boot/rp/Cargo.toml +++ b/embassy-boot/rp/Cargo.toml | |||
| @@ -25,7 +25,7 @@ embassy-time = { path = "../../embassy-time" } | |||
| 25 | cortex-m = { version = "0.7.6" } | 25 | cortex-m = { version = "0.7.6" } |
| 26 | cortex-m-rt = { version = "0.7" } | 26 | cortex-m-rt = { version = "0.7" } |
| 27 | embedded-storage = "0.3.0" | 27 | embedded-storage = "0.3.0" |
| 28 | embedded-storage-async = { version = "0.4.0", optional = true } | 28 | embedded-storage-async = { version = "0.4.0" } |
| 29 | cfg-if = "1.0.0" | 29 | cfg-if = "1.0.0" |
| 30 | 30 | ||
| 31 | [features] | 31 | [features] |
| @@ -40,12 +40,6 @@ log = [ | |||
| 40 | "embassy-rp/log", | 40 | "embassy-rp/log", |
| 41 | ] | 41 | ] |
| 42 | debug = ["defmt-rtt"] | 42 | debug = ["defmt-rtt"] |
| 43 | nightly = [ | ||
| 44 | "dep:embedded-storage-async", | ||
| 45 | "embassy-boot/nightly", | ||
| 46 | "embassy-rp/nightly", | ||
| 47 | "embassy-time/nightly" | ||
| 48 | ] | ||
| 49 | 43 | ||
| 50 | [profile.dev] | 44 | [profile.dev] |
| 51 | debug = 2 | 45 | debug = 2 |
diff --git a/embassy-boot/rp/src/lib.rs b/embassy-boot/rp/src/lib.rs index 989e7521b..07a5b3f4d 100644 --- a/embassy-boot/rp/src/lib.rs +++ b/embassy-boot/rp/src/lib.rs | |||
| @@ -4,10 +4,9 @@ | |||
| 4 | mod fmt; | 4 | mod fmt; |
| 5 | 5 | ||
| 6 | pub use embassy_boot::{ | 6 | pub use embassy_boot::{ |
| 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareUpdaterConfig, State, | 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareState, FirmwareUpdater, |
| 8 | FirmwareUpdaterConfig, State, | ||
| 8 | }; | 9 | }; |
| 9 | #[cfg(feature = "nightly")] | ||
| 10 | pub use embassy_boot::{FirmwareState, FirmwareUpdater}; | ||
| 11 | use embassy_rp::flash::{Blocking, Flash, ERASE_SIZE}; | 10 | use embassy_rp::flash::{Blocking, Flash, ERASE_SIZE}; |
| 12 | use embassy_rp::peripherals::{FLASH, WATCHDOG}; | 11 | use embassy_rp::peripherals::{FLASH, WATCHDOG}; |
| 13 | use embassy_rp::watchdog::Watchdog; | 12 | use embassy_rp::watchdog::Watchdog; |
diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml index da3102776..a9f0e4f0e 100644 --- a/embassy-boot/stm32/Cargo.toml +++ b/embassy-boot/stm32/Cargo.toml | |||
| @@ -24,26 +24,13 @@ embassy-boot = { path = "../boot", default-features = false } | |||
| 24 | cortex-m = { version = "0.7.6" } | 24 | cortex-m = { version = "0.7.6" } |
| 25 | cortex-m-rt = { version = "0.7" } | 25 | cortex-m-rt = { version = "0.7" } |
| 26 | embedded-storage = "0.3.0" | 26 | embedded-storage = "0.3.0" |
| 27 | embedded-storage-async = { version = "0.4.0", optional = true } | 27 | embedded-storage-async = { version = "0.4.0" } |
| 28 | cfg-if = "1.0.0" | 28 | cfg-if = "1.0.0" |
| 29 | 29 | ||
| 30 | [features] | 30 | [features] |
| 31 | defmt = [ | 31 | defmt = ["dep:defmt", "embassy-boot/defmt", "embassy-stm32/defmt"] |
| 32 | "dep:defmt", | 32 | log = ["dep:log", "embassy-boot/log", "embassy-stm32/log"] |
| 33 | "embassy-boot/defmt", | ||
| 34 | "embassy-stm32/defmt", | ||
| 35 | ] | ||
| 36 | log = [ | ||
| 37 | "dep:log", | ||
| 38 | "embassy-boot/log", | ||
| 39 | "embassy-stm32/log", | ||
| 40 | ] | ||
| 41 | debug = ["defmt-rtt"] | 33 | debug = ["defmt-rtt"] |
| 42 | nightly = [ | ||
| 43 | "dep:embedded-storage-async", | ||
| 44 | "embassy-boot/nightly", | ||
| 45 | "embassy-stm32/nightly" | ||
| 46 | ] | ||
| 47 | 34 | ||
| 48 | [profile.dev] | 35 | [profile.dev] |
| 49 | debug = 2 | 36 | debug = 2 |
diff --git a/embassy-boot/stm32/src/lib.rs b/embassy-boot/stm32/src/lib.rs index c6350c495..c418cb262 100644 --- a/embassy-boot/stm32/src/lib.rs +++ b/embassy-boot/stm32/src/lib.rs | |||
| @@ -4,10 +4,9 @@ | |||
| 4 | mod fmt; | 4 | mod fmt; |
| 5 | 5 | ||
| 6 | pub use embassy_boot::{ | 6 | pub use embassy_boot::{ |
| 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareUpdaterConfig, State, | 7 | AlignedBuffer, BlockingFirmwareState, BlockingFirmwareUpdater, BootLoaderConfig, FirmwareState, FirmwareUpdater, |
| 8 | FirmwareUpdaterConfig, State, | ||
| 8 | }; | 9 | }; |
| 9 | #[cfg(feature = "nightly")] | ||
| 10 | pub use embassy_boot::{FirmwareState, FirmwareUpdater}; | ||
| 11 | use embedded_storage::nor_flash::NorFlash; | 10 | use embedded_storage::nor_flash::NorFlash; |
| 12 | 11 | ||
| 13 | /// A bootloader for STM32 devices. | 12 | /// A bootloader for STM32 devices. |
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index 52ecd5c71..db4dc9587 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -8,27 +8,25 @@ license = "MIT OR Apache-2.0" | |||
| 8 | [package.metadata.embassy_docs] | 8 | [package.metadata.embassy_docs] |
| 9 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-embedded-hal-v$VERSION/embassy-embedded-hal/src/" | 9 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-embedded-hal-v$VERSION/embassy-embedded-hal/src/" |
| 10 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-embedded-hal/src/" | 10 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-embedded-hal/src/" |
| 11 | features = ["nightly", "std"] | 11 | features = ["std"] |
| 12 | target = "x86_64-unknown-linux-gnu" | 12 | target = "x86_64-unknown-linux-gnu" |
| 13 | 13 | ||
| 14 | [features] | 14 | [features] |
| 15 | std = [] | 15 | std = [] |
| 16 | # Enable nightly-only features | ||
| 17 | nightly = ["embassy-futures", "embedded-hal-async", "embedded-storage-async"] | ||
| 18 | time = ["dep:embassy-time"] | 16 | time = ["dep:embassy-time"] |
| 19 | default = ["time"] | 17 | default = ["time"] |
| 20 | 18 | ||
| 21 | [dependencies] | 19 | [dependencies] |
| 22 | embassy-futures = { version = "0.1.0", path = "../embassy-futures", optional = true } | 20 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 23 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } | 21 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } |
| 24 | embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true } | 22 | embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true } |
| 25 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ | 23 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ |
| 26 | "unproven", | 24 | "unproven", |
| 27 | ] } | 25 | ] } |
| 28 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } | 26 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 29 | embedded-hal-async = { version = "=1.0.0-rc.2", optional = true } | 27 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 30 | embedded-storage = "0.3.0" | 28 | embedded-storage = "0.3.0" |
| 31 | embedded-storage-async = { version = "0.4.0", optional = true } | 29 | embedded-storage-async = { version = "0.4.0" } |
| 32 | nb = "1.0.0" | 30 | nb = "1.0.0" |
| 33 | 31 | ||
| 34 | defmt = { version = "0.3", optional = true } | 32 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-embedded-hal/build.rs b/embassy-embedded-hal/build.rs new file mode 100644 index 000000000..78bd27ec7 --- /dev/null +++ b/embassy-embedded-hal/build.rs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | use std::env; | ||
| 2 | use std::ffi::OsString; | ||
| 3 | use std::process::Command; | ||
| 4 | |||
| 5 | fn main() { | ||
| 6 | println!("cargo:rerun-if-changed=build.rs"); | ||
| 7 | |||
| 8 | let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); | ||
| 9 | |||
| 10 | let output = Command::new(rustc) | ||
| 11 | .arg("--version") | ||
| 12 | .output() | ||
| 13 | .expect("failed to run `rustc --version`"); | ||
| 14 | |||
| 15 | if String::from_utf8_lossy(&output.stdout).contains("nightly") { | ||
| 16 | println!("cargo:rustc-cfg=nightly"); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/embassy-embedded-hal/src/flash/concat_flash.rs b/embassy-embedded-hal/src/flash/concat_flash.rs index 1ea84269c..499941d19 100644 --- a/embassy-embedded-hal/src/flash/concat_flash.rs +++ b/embassy-embedded-hal/src/flash/concat_flash.rs | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, ReadNorFlash}; | 1 | use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, ReadNorFlash}; |
| 2 | #[cfg(feature = "nightly")] | ||
| 3 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; | 2 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 4 | 3 | ||
| 5 | /// Convenience helper for concatenating two consecutive flashes into one. | 4 | /// Convenience helper for concatenating two consecutive flashes into one. |
| @@ -117,7 +116,6 @@ where | |||
| 117 | } | 116 | } |
| 118 | } | 117 | } |
| 119 | 118 | ||
| 120 | #[cfg(feature = "nightly")] | ||
| 121 | impl<First, Second, E> AsyncReadNorFlash for ConcatFlash<First, Second> | 119 | impl<First, Second, E> AsyncReadNorFlash for ConcatFlash<First, Second> |
| 122 | where | 120 | where |
| 123 | First: AsyncReadNorFlash<Error = E>, | 121 | First: AsyncReadNorFlash<Error = E>, |
| @@ -146,7 +144,6 @@ where | |||
| 146 | } | 144 | } |
| 147 | } | 145 | } |
| 148 | 146 | ||
| 149 | #[cfg(feature = "nightly")] | ||
| 150 | impl<First, Second, E> AsyncNorFlash for ConcatFlash<First, Second> | 147 | impl<First, Second, E> AsyncNorFlash for ConcatFlash<First, Second> |
| 151 | where | 148 | where |
| 152 | First: AsyncNorFlash<Error = E>, | 149 | First: AsyncNorFlash<Error = E>, |
diff --git a/embassy-embedded-hal/src/flash/mem_flash.rs b/embassy-embedded-hal/src/flash/mem_flash.rs index afb0d1a15..d24c61823 100644 --- a/embassy-embedded-hal/src/flash/mem_flash.rs +++ b/embassy-embedded-hal/src/flash/mem_flash.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | use alloc::vec::Vec; | 1 | use alloc::vec::Vec; |
| 2 | 2 | ||
| 3 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; | 3 | use embedded_storage::nor_flash::{ErrorType, NorFlash, ReadNorFlash}; |
| 4 | #[cfg(feature = "nightly")] | ||
| 5 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; | 4 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 6 | 5 | ||
| 7 | extern crate alloc; | 6 | extern crate alloc; |
| @@ -93,7 +92,6 @@ impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> NorFla | |||
| 93 | } | 92 | } |
| 94 | } | 93 | } |
| 95 | 94 | ||
| 96 | #[cfg(feature = "nightly")] | ||
| 97 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncReadNorFlash | 95 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncReadNorFlash |
| 98 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> | 96 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> |
| 99 | { | 97 | { |
| @@ -109,7 +107,6 @@ impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncR | |||
| 109 | } | 107 | } |
| 110 | } | 108 | } |
| 111 | 109 | ||
| 112 | #[cfg(feature = "nightly")] | ||
| 113 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncNorFlash | 110 | impl<const SIZE: usize, const ERASE_SIZE: usize, const WRITE_SIZE: usize> AsyncNorFlash |
| 114 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> | 111 | for MemFlash<SIZE, ERASE_SIZE, WRITE_SIZE> |
| 115 | { | 112 | { |
diff --git a/embassy-embedded-hal/src/flash/partition/mod.rs b/embassy-embedded-hal/src/flash/partition/mod.rs index 42c8a308d..6177ed9ab 100644 --- a/embassy-embedded-hal/src/flash/partition/mod.rs +++ b/embassy-embedded-hal/src/flash/partition/mod.rs | |||
| @@ -2,11 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind}; | 3 | use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind}; |
| 4 | 4 | ||
| 5 | #[cfg(feature = "nightly")] | ||
| 6 | mod asynch; | 5 | mod asynch; |
| 7 | mod blocking; | 6 | mod blocking; |
| 8 | 7 | ||
| 9 | #[cfg(feature = "nightly")] | ||
| 10 | pub use asynch::Partition; | 8 | pub use asynch::Partition; |
| 11 | pub use blocking::BlockingPartition; | 9 | pub use blocking::BlockingPartition; |
| 12 | 10 | ||
diff --git a/embassy-embedded-hal/src/lib.rs b/embassy-embedded-hal/src/lib.rs index ce5fac3f0..b40f892f4 100644 --- a/embassy-embedded-hal/src/lib.rs +++ b/embassy-embedded-hal/src/lib.rs | |||
| @@ -1,15 +1,13 @@ | |||
| 1 | #![cfg_attr(not(feature = "std"), no_std)] | 1 | #![cfg_attr(not(feature = "std"), no_std)] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | 3 | #![cfg_attr(nightly, allow(stable_features, unknown_lints))] |
| 4 | #![allow(async_fn_in_trait)] | ||
| 4 | #![warn(missing_docs)] | 5 | #![warn(missing_docs)] |
| 5 | 6 | ||
| 6 | //! Utilities to use `embedded-hal` traits with Embassy. | 7 | //! Utilities to use `embedded-hal` traits with Embassy. |
| 7 | 8 | ||
| 8 | #[cfg(feature = "nightly")] | ||
| 9 | pub mod adapter; | 9 | pub mod adapter; |
| 10 | |||
| 11 | pub mod flash; | 10 | pub mod flash; |
| 12 | |||
| 13 | pub mod shared_bus; | 11 | pub mod shared_bus; |
| 14 | 12 | ||
| 15 | /// Set the configuration of a peripheral driver. | 13 | /// Set the configuration of a peripheral driver. |
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs index 1053d3849..779c04263 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs | |||
| @@ -2,16 +2,15 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! # Example (nrf52) | 3 | //! # Example (nrf52) |
| 4 | //! | 4 | //! |
| 5 | //! ```rust | 5 | //! ```rust,ignore |
| 6 | //! use embassy_embedded_hal::shared_bus::i2c::I2cDevice; | 6 | //! use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice; |
| 7 | //! use embassy_sync::mutex::Mutex; | 7 | //! use embassy_sync::mutex::Mutex; |
| 8 | //! use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 8 | //! use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 9 | //! | 9 | //! |
| 10 | //! static I2C_BUS: StaticCell<Mutex::<ThreadModeRawMutex, Twim<TWISPI0>>> = StaticCell::new(); | 10 | //! static I2C_BUS: StaticCell<Mutex<NoopRawMutex, Twim<TWISPI0>>> = StaticCell::new(); |
| 11 | //! let config = twim::Config::default(); | 11 | //! let config = twim::Config::default(); |
| 12 | //! let irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0); | 12 | //! let i2c = Twim::new(p.TWISPI0, Irqs, p.P0_03, p.P0_04, config); |
| 13 | //! let i2c = Twim::new(p.TWISPI0, irq, p.P0_03, p.P0_04, config); | 13 | //! let i2c_bus = Mutex::new(i2c); |
| 14 | //! let i2c_bus = Mutex::<ThreadModeRawMutex, _>::new(i2c); | ||
| 15 | //! let i2c_bus = I2C_BUS.init(i2c_bus); | 14 | //! let i2c_bus = I2C_BUS.init(i2c_bus); |
| 16 | //! | 15 | //! |
| 17 | //! // Device 1, using embedded-hal-async compatible driver for QMC5883L compass | 16 | //! // Device 1, using embedded-hal-async compatible driver for QMC5883L compass |
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs index b4f53c623..62b2c92a0 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs | |||
| @@ -2,17 +2,16 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! # Example (nrf52) | 3 | //! # Example (nrf52) |
| 4 | //! | 4 | //! |
| 5 | //! ```rust | 5 | //! ```rust,ignore |
| 6 | //! use embassy_embedded_hal::shared_bus::spi::SpiDevice; | 6 | //! use embassy_embedded_hal::shared_bus::spi::SpiDevice; |
| 7 | //! use embassy_sync::mutex::Mutex; | 7 | //! use embassy_sync::mutex::Mutex; |
| 8 | //! use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 8 | //! use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 9 | //! | 9 | //! |
| 10 | //! static SPI_BUS: StaticCell<Mutex<ThreadModeRawMutex, spim::Spim<SPI3>>> = StaticCell::new(); | 10 | //! static SPI_BUS: StaticCell<Mutex<NoopRawMutex, spim::Spim<SPI3>>> = StaticCell::new(); |
| 11 | //! let mut config = spim::Config::default(); | 11 | //! let mut config = spim::Config::default(); |
| 12 | //! config.frequency = spim::Frequency::M32; | 12 | //! config.frequency = spim::Frequency::M32; |
| 13 | //! let irq = interrupt::take!(SPIM3); | 13 | //! let spi = spim::Spim::new_txonly(p.SPI3, Irqs, p.P0_15, p.P0_18, config); |
| 14 | //! let spi = spim::Spim::new_txonly(p.SPI3, irq, p.P0_15, p.P0_18, config); | 14 | //! let spi_bus = Mutex::new(spi); |
| 15 | //! let spi_bus = Mutex::<ThreadModeRawMutex, _>::new(spi); | ||
| 16 | //! let spi_bus = SPI_BUS.init(spi_bus); | 15 | //! let spi_bus = SPI_BUS.init(spi_bus); |
| 17 | //! | 16 | //! |
| 18 | //! // Device 1, using embedded-hal-async compatible driver for ST7735 LCD display | 17 | //! // Device 1, using embedded-hal-async compatible driver for ST7735 LCD display |
diff --git a/embassy-embedded-hal/src/shared_bus/mod.rs b/embassy-embedded-hal/src/shared_bus/mod.rs index ab96df134..d835306bc 100644 --- a/embassy-embedded-hal/src/shared_bus/mod.rs +++ b/embassy-embedded-hal/src/shared_bus/mod.rs | |||
| @@ -3,9 +3,7 @@ use core::fmt::Debug; | |||
| 3 | 3 | ||
| 4 | use embedded_hal_1::{i2c, spi}; | 4 | use embedded_hal_1::{i2c, spi}; |
| 5 | 5 | ||
| 6 | #[cfg(feature = "nightly")] | ||
| 7 | pub mod asynch; | 6 | pub mod asynch; |
| 8 | |||
| 9 | pub mod blocking; | 7 | pub mod blocking; |
| 10 | 8 | ||
| 11 | /// Error returned by I2C device implementations in this crate. | 9 | /// Error returned by I2C device implementations in this crate. |
diff --git a/embassy-net-adin1110/src/lib.rs b/embassy-net-adin1110/src/lib.rs index e4a3cb209..080b3f94d 100644 --- a/embassy-net-adin1110/src/lib.rs +++ b/embassy-net-adin1110/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![deny(clippy::pedantic)] | 1 | #![deny(clippy::pedantic)] |
| 2 | #![feature(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 4 | #![cfg_attr(not(any(test, feature = "std")), no_std)] | 3 | #![cfg_attr(not(any(test, feature = "std")), no_std)] |
| 5 | #![allow(clippy::module_name_repetitions)] | 4 | #![allow(clippy::module_name_repetitions)] |
| 6 | #![allow(clippy::missing_errors_doc)] | 5 | #![allow(clippy::missing_errors_doc)] |
diff --git a/embassy-net-wiznet/src/lib.rs b/embassy-net-wiznet/src/lib.rs index 21d5f46d4..f26f2bbb7 100644 --- a/embassy-net-wiznet/src/lib.rs +++ b/embassy-net-wiznet/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![feature(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 4 | #![doc = include_str!("../README.md")] | 3 | #![doc = include_str!("../README.md")] |
| 5 | 4 | ||
| 6 | pub mod chip; | 5 | pub mod chip; |
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index fe8344f5b..f106582e8 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml | |||
| @@ -15,11 +15,11 @@ categories = [ | |||
| 15 | [package.metadata.embassy_docs] | 15 | [package.metadata.embassy_docs] |
| 16 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-v$VERSION/embassy-net/src/" | 16 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-v$VERSION/embassy-net/src/" |
| 17 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net/src/" | 17 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net/src/" |
| 18 | features = ["nightly", "defmt", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "igmp"] | 18 | features = ["defmt", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "igmp"] |
| 19 | target = "thumbv7em-none-eabi" | 19 | target = "thumbv7em-none-eabi" |
| 20 | 20 | ||
| 21 | [package.metadata.docs.rs] | 21 | [package.metadata.docs.rs] |
| 22 | features = ["nightly", "defmt", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "igmp"] | 22 | features = ["defmt", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "igmp"] |
| 23 | 23 | ||
| 24 | [features] | 24 | [features] |
| 25 | default = [] | 25 | default = [] |
| @@ -27,8 +27,6 @@ std = [] | |||
| 27 | 27 | ||
| 28 | defmt = ["dep:defmt", "smoltcp/defmt", "embassy-net-driver/defmt", "heapless/defmt-03"] | 28 | defmt = ["dep:defmt", "smoltcp/defmt", "embassy-net-driver/defmt", "heapless/defmt-03"] |
| 29 | 29 | ||
| 30 | nightly = ["dep:embedded-io-async", "dep:embedded-nal-async"] | ||
| 31 | |||
| 32 | udp = ["smoltcp/socket-udp"] | 30 | udp = ["smoltcp/socket-udp"] |
| 33 | tcp = ["smoltcp/socket-tcp"] | 31 | tcp = ["smoltcp/socket-tcp"] |
| 34 | dns = ["smoltcp/socket-dns", "smoltcp/proto-dns"] | 32 | dns = ["smoltcp/socket-dns", "smoltcp/proto-dns"] |
| @@ -54,7 +52,7 @@ smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp.git", rev = "b57e2f9e70 | |||
| 54 | embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" } | 52 | embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" } |
| 55 | embassy-time = { version = "0.1.5", path = "../embassy-time" } | 53 | embassy-time = { version = "0.1.5", path = "../embassy-time" } |
| 56 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } | 54 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } |
| 57 | embedded-io-async = { version = "0.6.1", optional = true } | 55 | embedded-io-async = { version = "0.6.1" } |
| 58 | 56 | ||
| 59 | managed = { version = "0.8.0", default-features = false, features = [ "map" ] } | 57 | managed = { version = "0.8.0", default-features = false, features = [ "map" ] } |
| 60 | heapless = { version = "0.8", default-features = false } | 58 | heapless = { version = "0.8", default-features = false } |
| @@ -63,4 +61,4 @@ generic-array = { version = "0.14.4", default-features = false } | |||
| 63 | stable_deref_trait = { version = "1.2.0", default-features = false } | 61 | stable_deref_trait = { version = "1.2.0", default-features = false } |
| 64 | futures = { version = "0.3.17", default-features = false, features = [ "async-await" ] } | 62 | futures = { version = "0.3.17", default-features = false, features = [ "async-await" ] } |
| 65 | atomic-pool = "1.0" | 63 | atomic-pool = "1.0" |
| 66 | embedded-nal-async = { version = "0.7.1", optional = true } | 64 | embedded-nal-async = { version = "0.7.1" } |
diff --git a/embassy-net/build.rs b/embassy-net/build.rs new file mode 100644 index 000000000..78bd27ec7 --- /dev/null +++ b/embassy-net/build.rs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | use std::env; | ||
| 2 | use std::ffi::OsString; | ||
| 3 | use std::process::Command; | ||
| 4 | |||
| 5 | fn main() { | ||
| 6 | println!("cargo:rerun-if-changed=build.rs"); | ||
| 7 | |||
| 8 | let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); | ||
| 9 | |||
| 10 | let output = Command::new(rustc) | ||
| 11 | .arg("--version") | ||
| 12 | .output() | ||
| 13 | .expect("failed to run `rustc --version`"); | ||
| 14 | |||
| 15 | if String::from_utf8_lossy(&output.stdout).contains("nightly") { | ||
| 16 | println!("cargo:rustc-cfg=nightly"); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/embassy-net/src/dns.rs b/embassy-net/src/dns.rs index 69fc5cdf1..a1151d5e4 100644 --- a/embassy-net/src/dns.rs +++ b/embassy-net/src/dns.rs | |||
| @@ -72,7 +72,6 @@ where | |||
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | #[cfg(feature = "nightly")] | ||
| 76 | impl<'a, D> embedded_nal_async::Dns for DnsSocket<'a, D> | 75 | impl<'a, D> embedded_nal_async::Dns for DnsSocket<'a, D> |
| 77 | where | 76 | where |
| 78 | D: Driver + 'static, | 77 | D: Driver + 'static, |
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 58310b203..bf1468642 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #![cfg_attr(not(feature = "std"), no_std)] | 1 | #![cfg_attr(not(feature = "std"), no_std)] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | 3 | #![cfg_attr(nightly, allow(stable_features, unknown_lints))] |
| 4 | #![allow(async_fn_in_trait)] | ||
| 4 | #![warn(missing_docs)] | 5 | #![warn(missing_docs)] |
| 5 | #![doc = include_str!("../README.md")] | 6 | #![doc = include_str!("../README.md")] |
| 6 | 7 | ||
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index 90fd08e94..dcfb5c96e 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs | |||
| @@ -515,7 +515,6 @@ impl<'d> TcpIo<'d> { | |||
| 515 | } | 515 | } |
| 516 | } | 516 | } |
| 517 | 517 | ||
| 518 | #[cfg(feature = "nightly")] | ||
| 519 | mod embedded_io_impls { | 518 | mod embedded_io_impls { |
| 520 | use super::*; | 519 | use super::*; |
| 521 | 520 | ||
| @@ -584,7 +583,6 @@ mod embedded_io_impls { | |||
| 584 | } | 583 | } |
| 585 | 584 | ||
| 586 | /// TCP client compatible with `embedded-nal-async` traits. | 585 | /// TCP client compatible with `embedded-nal-async` traits. |
| 587 | #[cfg(feature = "nightly")] | ||
| 588 | pub mod client { | 586 | pub mod client { |
| 589 | use core::cell::{Cell, UnsafeCell}; | 587 | use core::cell::{Cell, UnsafeCell}; |
| 590 | use core::mem::MaybeUninit; | 588 | use core::mem::MaybeUninit; |
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index a75a94f02..bde15267b 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-nrf-v$VERSION/embassy-nrf/src/" | 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-nrf-v$VERSION/embassy-nrf/src/" |
| 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-nrf/src/" | 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-nrf/src/" |
| 10 | 10 | ||
| 11 | features = ["nightly", "time", "defmt", "unstable-pac", "unstable-traits", "gpiote", "time-driver-rtc1"] | 11 | features = ["time", "defmt", "unstable-pac", "gpiote", "time-driver-rtc1"] |
| 12 | flavors = [ | 12 | flavors = [ |
| 13 | { regex_feature = "nrf52.*", target = "thumbv7em-none-eabihf" }, | 13 | { regex_feature = "nrf52.*", target = "thumbv7em-none-eabihf" }, |
| 14 | { regex_feature = "nrf53.*", target = "thumbv8m.main-none-eabihf" }, | 14 | { regex_feature = "nrf53.*", target = "thumbv8m.main-none-eabihf" }, |
| @@ -32,10 +32,7 @@ rt = [ | |||
| 32 | 32 | ||
| 33 | time = ["dep:embassy-time"] | 33 | time = ["dep:embassy-time"] |
| 34 | 34 | ||
| 35 | defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver?/defmt", "embassy-embedded-hal/defmt"] | 35 | defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver/defmt", "embassy-embedded-hal/defmt"] |
| 36 | |||
| 37 | # Enable nightly-only features | ||
| 38 | nightly = ["embedded-hal-1", "embedded-hal-async", "dep:embassy-usb-driver", "embedded-storage-async", "dep:embedded-io-async", "embassy-embedded-hal/nightly"] | ||
| 39 | 36 | ||
| 40 | # Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. | 37 | # Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. |
| 41 | # This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. | 38 | # This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. |
| @@ -43,10 +40,6 @@ nightly = ["embedded-hal-1", "embedded-hal-async", "dep:embassy-usb-driver", "em | |||
| 43 | # There are no plans to make this stable. | 40 | # There are no plans to make this stable. |
| 44 | unstable-pac = [] | 41 | unstable-pac = [] |
| 45 | 42 | ||
| 46 | # Implement embedded-hal 1.0 alpha traits. | ||
| 47 | # Implement embedded-hal-async traits if `nightly` is set as well. | ||
| 48 | unstable-traits = ["embedded-hal-1"] | ||
| 49 | |||
| 50 | nrf52805 = ["nrf52805-pac", "_nrf52"] | 43 | nrf52805 = ["nrf52805-pac", "_nrf52"] |
| 51 | nrf52810 = ["nrf52810-pac", "_nrf52"] | 44 | nrf52810 = ["nrf52810-pac", "_nrf52"] |
| 52 | nrf52811 = ["nrf52811-pac", "_nrf52"] | 45 | nrf52811 = ["nrf52811-pac", "_nrf52"] |
| @@ -98,13 +91,13 @@ embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true } | |||
| 98 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } | 91 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } |
| 99 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] } | 92 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] } |
| 100 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 93 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
| 101 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional=true } | 94 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver" } |
| 102 | 95 | ||
| 103 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 96 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 104 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2", optional = true} | 97 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 105 | embedded-hal-async = { version = "=1.0.0-rc.2", optional = true} | 98 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 106 | embedded-io = { version = "0.6.0" } | 99 | embedded-io = { version = "0.6.0" } |
| 107 | embedded-io-async = { version = "0.6.1", optional = true } | 100 | embedded-io-async = { version = "0.6.1" } |
| 108 | 101 | ||
| 109 | defmt = { version = "0.3", optional = true } | 102 | defmt = { version = "0.3", optional = true } |
| 110 | log = { version = "0.4.14", optional = true } | 103 | log = { version = "0.4.14", optional = true } |
| @@ -114,7 +107,7 @@ critical-section = "1.1" | |||
| 114 | rand_core = "0.6.3" | 107 | rand_core = "0.6.3" |
| 115 | fixed = "1.10.0" | 108 | fixed = "1.10.0" |
| 116 | embedded-storage = "0.3.0" | 109 | embedded-storage = "0.3.0" |
| 117 | embedded-storage-async = { version = "0.4.0", optional = true } | 110 | embedded-storage-async = "0.4.0" |
| 118 | cfg-if = "1.0.0" | 111 | cfg-if = "1.0.0" |
| 119 | 112 | ||
| 120 | nrf52805-pac = { version = "0.12.0", optional = true } | 113 | nrf52805-pac = { version = "0.12.0", optional = true } |
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index e4b556f06..4ac622d34 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -607,7 +607,6 @@ impl<'u, 'd, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'u, 'd, U, T> { | |||
| 607 | } | 607 | } |
| 608 | } | 608 | } |
| 609 | 609 | ||
| 610 | #[cfg(feature = "nightly")] | ||
| 611 | mod _embedded_io { | 610 | mod _embedded_io { |
| 612 | use super::*; | 611 | use super::*; |
| 613 | 612 | ||
diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs index 0ecddaf31..85184d48c 100644 --- a/embassy-nrf/src/chips/nrf52820.rs +++ b/embassy-nrf/src/chips/nrf52820.rs | |||
| @@ -131,7 +131,6 @@ embassy_hal_internal::peripherals! { | |||
| 131 | QDEC, | 131 | QDEC, |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | #[cfg(feature = "nightly")] | ||
| 135 | impl_usb!(USBD, USBD, USBD); | 134 | impl_usb!(USBD, USBD, USBD); |
| 136 | 135 | ||
| 137 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); | 136 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); |
diff --git a/embassy-nrf/src/chips/nrf52833.rs b/embassy-nrf/src/chips/nrf52833.rs index b8830b338..342ae8b15 100644 --- a/embassy-nrf/src/chips/nrf52833.rs +++ b/embassy-nrf/src/chips/nrf52833.rs | |||
| @@ -171,7 +171,6 @@ embassy_hal_internal::peripherals! { | |||
| 171 | I2S, | 171 | I2S, |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | #[cfg(feature = "nightly")] | ||
| 175 | impl_usb!(USBD, USBD, USBD); | 174 | impl_usb!(USBD, USBD, USBD); |
| 176 | 175 | ||
| 177 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); | 176 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); |
diff --git a/embassy-nrf/src/chips/nrf52840.rs b/embassy-nrf/src/chips/nrf52840.rs index a490cb079..a5cbd798a 100644 --- a/embassy-nrf/src/chips/nrf52840.rs +++ b/embassy-nrf/src/chips/nrf52840.rs | |||
| @@ -174,7 +174,6 @@ embassy_hal_internal::peripherals! { | |||
| 174 | I2S, | 174 | I2S, |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | #[cfg(feature = "nightly")] | ||
| 178 | impl_usb!(USBD, USBD, USBD); | 177 | impl_usb!(USBD, USBD, USBD); |
| 179 | 178 | ||
| 180 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); | 179 | impl_uarte!(UARTE0, UARTE0, UARTE0_UART0); |
diff --git a/embassy-nrf/src/chips/nrf5340_app.rs b/embassy-nrf/src/chips/nrf5340_app.rs index 5e9a8ed05..62c74bb6f 100644 --- a/embassy-nrf/src/chips/nrf5340_app.rs +++ b/embassy-nrf/src/chips/nrf5340_app.rs | |||
| @@ -382,7 +382,6 @@ embassy_hal_internal::peripherals! { | |||
| 382 | P1_15, | 382 | P1_15, |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | #[cfg(feature = "nightly")] | ||
| 386 | impl_usb!(USBD, USBD, USBD); | 385 | impl_usb!(USBD, USBD, USBD); |
| 387 | 386 | ||
| 388 | impl_uarte!(SERIAL0, UARTE0, SERIAL0); | 387 | impl_uarte!(SERIAL0, UARTE0, SERIAL0); |
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs index ea2b76096..cf6225282 100644 --- a/embassy-nrf/src/gpio.rs +++ b/embassy-nrf/src/gpio.rs | |||
| @@ -566,82 +566,77 @@ mod eh02 { | |||
| 566 | } | 566 | } |
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | #[cfg(feature = "unstable-traits")] | 569 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { |
| 570 | mod eh1 { | 570 | type Error = Infallible; |
| 571 | use super::*; | 571 | } |
| 572 | 572 | ||
| 573 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { | 573 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { |
| 574 | type Error = Infallible; | 574 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 575 | Ok(self.is_high()) | ||
| 575 | } | 576 | } |
| 576 | 577 | ||
| 577 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { | 578 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 578 | fn is_high(&self) -> Result<bool, Self::Error> { | 579 | Ok(self.is_low()) |
| 579 | Ok(self.is_high()) | 580 | } |
| 580 | } | 581 | } |
| 581 | 582 | ||
| 582 | fn is_low(&self) -> Result<bool, Self::Error> { | 583 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Output<'d, T> { |
| 583 | Ok(self.is_low()) | 584 | type Error = Infallible; |
| 584 | } | 585 | } |
| 586 | |||
| 587 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { | ||
| 588 | fn set_high(&mut self) -> Result<(), Self::Error> { | ||
| 589 | Ok(self.set_high()) | ||
| 585 | } | 590 | } |
| 586 | 591 | ||
| 587 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Output<'d, T> { | 592 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 588 | type Error = Infallible; | 593 | Ok(self.set_low()) |
| 589 | } | 594 | } |
| 595 | } | ||
| 590 | 596 | ||
| 591 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { | 597 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { |
| 592 | fn set_high(&mut self) -> Result<(), Self::Error> { | 598 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 593 | Ok(self.set_high()) | 599 | Ok(self.is_set_high()) |
| 594 | } | 600 | } |
| 595 | 601 | ||
| 596 | fn set_low(&mut self) -> Result<(), Self::Error> { | 602 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 597 | Ok(self.set_low()) | 603 | Ok(self.is_set_low()) |
| 598 | } | ||
| 599 | } | 604 | } |
| 605 | } | ||
| 600 | 606 | ||
| 601 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { | 607 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Flex<'d, T> { |
| 602 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 608 | type Error = Infallible; |
| 603 | Ok(self.is_set_high()) | 609 | } |
| 604 | } | ||
| 605 | 610 | ||
| 606 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 611 | /// Implement [`InputPin`] for [`Flex`]; |
| 607 | Ok(self.is_set_low()) | 612 | /// |
| 608 | } | 613 | /// If the pin is not in input mode the result is unspecified. |
| 614 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { | ||
| 615 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 616 | Ok(self.is_high()) | ||
| 609 | } | 617 | } |
| 610 | 618 | ||
| 611 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Flex<'d, T> { | 619 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 612 | type Error = Infallible; | 620 | Ok(self.is_low()) |
| 613 | } | 621 | } |
| 622 | } | ||
| 614 | 623 | ||
| 615 | /// Implement [`InputPin`] for [`Flex`]; | 624 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { |
| 616 | /// | 625 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 617 | /// If the pin is not in input mode the result is unspecified. | 626 | Ok(self.set_high()) |
| 618 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { | ||
| 619 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 620 | Ok(self.is_high()) | ||
| 621 | } | ||
| 622 | |||
| 623 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 624 | Ok(self.is_low()) | ||
| 625 | } | ||
| 626 | } | 627 | } |
| 627 | 628 | ||
| 628 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { | 629 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 629 | fn set_high(&mut self) -> Result<(), Self::Error> { | 630 | Ok(self.set_low()) |
| 630 | Ok(self.set_high()) | ||
| 631 | } | ||
| 632 | |||
| 633 | fn set_low(&mut self) -> Result<(), Self::Error> { | ||
| 634 | Ok(self.set_low()) | ||
| 635 | } | ||
| 636 | } | 631 | } |
| 632 | } | ||
| 637 | 633 | ||
| 638 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { | 634 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { |
| 639 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 635 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 640 | Ok(self.is_set_high()) | 636 | Ok(self.is_set_high()) |
| 641 | } | 637 | } |
| 642 | 638 | ||
| 643 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 639 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 644 | Ok(self.is_set_low()) | 640 | Ok(self.is_set_low()) |
| 645 | } | ||
| 646 | } | 641 | } |
| 647 | } | 642 | } |
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index d16b4a43b..fd629ea76 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs | |||
| @@ -490,70 +490,60 @@ mod eh02 { | |||
| 490 | } | 490 | } |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | #[cfg(feature = "unstable-traits")] | 493 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::ErrorType for InputChannel<'d, C, T> { |
| 494 | mod eh1 { | 494 | type Error = Infallible; |
| 495 | use super::*; | 495 | } |
| 496 | 496 | ||
| 497 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::ErrorType for InputChannel<'d, C, T> { | 497 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::InputPin for InputChannel<'d, C, T> { |
| 498 | type Error = Infallible; | 498 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 499 | Ok(self.pin.is_high()) | ||
| 499 | } | 500 | } |
| 500 | 501 | ||
| 501 | impl<'d, C: Channel, T: GpioPin> embedded_hal_1::digital::InputPin for InputChannel<'d, C, T> { | 502 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 502 | fn is_high(&self) -> Result<bool, Self::Error> { | 503 | Ok(self.pin.is_low()) |
| 503 | Ok(self.pin.is_high()) | ||
| 504 | } | ||
| 505 | |||
| 506 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 507 | Ok(self.pin.is_low()) | ||
| 508 | } | ||
| 509 | } | 504 | } |
| 510 | } | 505 | } |
| 511 | 506 | ||
| 512 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 507 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for Input<'d, T> { |
| 513 | mod eha { | 508 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { |
| 514 | use super::*; | 509 | Ok(self.wait_for_high().await) |
| 515 | 510 | } | |
| 516 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for Input<'d, T> { | ||
| 517 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | ||
| 518 | Ok(self.wait_for_high().await) | ||
| 519 | } | ||
| 520 | 511 | ||
| 521 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 512 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 522 | Ok(self.wait_for_low().await) | 513 | Ok(self.wait_for_low().await) |
| 523 | } | 514 | } |
| 524 | 515 | ||
| 525 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 516 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 526 | Ok(self.wait_for_rising_edge().await) | 517 | Ok(self.wait_for_rising_edge().await) |
| 527 | } | 518 | } |
| 528 | 519 | ||
| 529 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 520 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 530 | Ok(self.wait_for_falling_edge().await) | 521 | Ok(self.wait_for_falling_edge().await) |
| 531 | } | 522 | } |
| 532 | 523 | ||
| 533 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 524 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 534 | Ok(self.wait_for_any_edge().await) | 525 | Ok(self.wait_for_any_edge().await) |
| 535 | } | ||
| 536 | } | 526 | } |
| 527 | } | ||
| 537 | 528 | ||
| 538 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for Flex<'d, T> { | 529 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for Flex<'d, T> { |
| 539 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | 530 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { |
| 540 | Ok(self.wait_for_high().await) | 531 | Ok(self.wait_for_high().await) |
| 541 | } | 532 | } |
| 542 | 533 | ||
| 543 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 534 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 544 | Ok(self.wait_for_low().await) | 535 | Ok(self.wait_for_low().await) |
| 545 | } | 536 | } |
| 546 | 537 | ||
| 547 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 538 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 548 | Ok(self.wait_for_rising_edge().await) | 539 | Ok(self.wait_for_rising_edge().await) |
| 549 | } | 540 | } |
| 550 | 541 | ||
| 551 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 542 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 552 | Ok(self.wait_for_falling_edge().await) | 543 | Ok(self.wait_for_falling_edge().await) |
| 553 | } | 544 | } |
| 554 | 545 | ||
| 555 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 546 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 556 | Ok(self.wait_for_any_edge().await) | 547 | Ok(self.wait_for_any_edge().await) |
| 557 | } | ||
| 558 | } | 548 | } |
| 559 | } | 549 | } |
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 715281119..ed8aad89b 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | ||
| 4 | #![doc = include_str!("../README.md")] | 3 | #![doc = include_str!("../README.md")] |
| 5 | #![warn(missing_docs)] | 4 | #![warn(missing_docs)] |
| 6 | 5 | ||
| @@ -76,7 +75,6 @@ pub mod uarte; | |||
| 76 | feature = "nrf52833", | 75 | feature = "nrf52833", |
| 77 | feature = "nrf52840" | 76 | feature = "nrf52840" |
| 78 | ))] | 77 | ))] |
| 79 | #[cfg(feature = "nightly")] | ||
| 80 | pub mod usb; | 78 | pub mod usb; |
| 81 | #[cfg(not(feature = "_nrf5340"))] | 79 | #[cfg(not(feature = "_nrf5340"))] |
| 82 | pub mod wdt; | 80 | pub mod wdt; |
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index 36ee33f6d..add093b63 100644 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs | |||
| @@ -585,7 +585,6 @@ impl<'d, T: Instance> NorFlash for Qspi<'d, T> { | |||
| 585 | } | 585 | } |
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | #[cfg(feature = "nightly")] | ||
| 589 | mod _eh1 { | 588 | mod _eh1 { |
| 590 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; | 589 | use embedded_storage_async::nor_flash::{NorFlash as AsyncNorFlash, ReadNorFlash as AsyncReadNorFlash}; |
| 591 | 590 | ||
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs index caf681d99..5d3c3268c 100644 --- a/embassy-nrf/src/spim.rs +++ b/embassy-nrf/src/spim.rs | |||
| @@ -495,72 +495,61 @@ mod eh02 { | |||
| 495 | } | 495 | } |
| 496 | } | 496 | } |
| 497 | 497 | ||
| 498 | #[cfg(feature = "unstable-traits")] | 498 | impl embedded_hal_1::spi::Error for Error { |
| 499 | mod eh1 { | 499 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { |
| 500 | use super::*; | 500 | match *self { |
| 501 | 501 | Self::TxBufferTooLong => embedded_hal_1::spi::ErrorKind::Other, | |
| 502 | impl embedded_hal_1::spi::Error for Error { | 502 | Self::RxBufferTooLong => embedded_hal_1::spi::ErrorKind::Other, |
| 503 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { | 503 | Self::BufferNotInRAM => embedded_hal_1::spi::ErrorKind::Other, |
| 504 | match *self { | ||
| 505 | Self::TxBufferTooLong => embedded_hal_1::spi::ErrorKind::Other, | ||
| 506 | Self::RxBufferTooLong => embedded_hal_1::spi::ErrorKind::Other, | ||
| 507 | Self::BufferNotInRAM => embedded_hal_1::spi::ErrorKind::Other, | ||
| 508 | } | ||
| 509 | } | 504 | } |
| 510 | } | 505 | } |
| 506 | } | ||
| 511 | 507 | ||
| 512 | impl<'d, T: Instance> embedded_hal_1::spi::ErrorType for Spim<'d, T> { | 508 | impl<'d, T: Instance> embedded_hal_1::spi::ErrorType for Spim<'d, T> { |
| 513 | type Error = Error; | 509 | type Error = Error; |
| 514 | } | 510 | } |
| 515 | 511 | ||
| 516 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBus<u8> for Spim<'d, T> { | 512 | impl<'d, T: Instance> embedded_hal_1::spi::SpiBus<u8> for Spim<'d, T> { |
| 517 | fn flush(&mut self) -> Result<(), Self::Error> { | 513 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 518 | Ok(()) | 514 | Ok(()) |
| 519 | } | 515 | } |
| 520 | 516 | ||
| 521 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 517 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 522 | self.blocking_transfer(words, &[]) | 518 | self.blocking_transfer(words, &[]) |
| 523 | } | 519 | } |
| 524 | 520 | ||
| 525 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 521 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 526 | self.blocking_write(words) | 522 | self.blocking_write(words) |
| 527 | } | 523 | } |
| 528 | 524 | ||
| 529 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { | 525 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { |
| 530 | self.blocking_transfer(read, write) | 526 | self.blocking_transfer(read, write) |
| 531 | } | 527 | } |
| 532 | 528 | ||
| 533 | fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 529 | fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 534 | self.blocking_transfer_in_place(words) | 530 | self.blocking_transfer_in_place(words) |
| 535 | } | ||
| 536 | } | 531 | } |
| 537 | } | 532 | } |
| 538 | 533 | ||
| 539 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 534 | impl<'d, T: Instance> embedded_hal_async::spi::SpiBus<u8> for Spim<'d, T> { |
| 540 | mod eha { | 535 | async fn flush(&mut self) -> Result<(), Error> { |
| 541 | 536 | Ok(()) | |
| 542 | use super::*; | 537 | } |
| 543 | |||
| 544 | impl<'d, T: Instance> embedded_hal_async::spi::SpiBus<u8> for Spim<'d, T> { | ||
| 545 | async fn flush(&mut self) -> Result<(), Error> { | ||
| 546 | Ok(()) | ||
| 547 | } | ||
| 548 | 538 | ||
| 549 | async fn read(&mut self, words: &mut [u8]) -> Result<(), Error> { | 539 | async fn read(&mut self, words: &mut [u8]) -> Result<(), Error> { |
| 550 | self.read(words).await | 540 | self.read(words).await |
| 551 | } | 541 | } |
| 552 | 542 | ||
| 553 | async fn write(&mut self, data: &[u8]) -> Result<(), Error> { | 543 | async fn write(&mut self, data: &[u8]) -> Result<(), Error> { |
| 554 | self.write(data).await | 544 | self.write(data).await |
| 555 | } | 545 | } |
| 556 | 546 | ||
| 557 | async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]) -> Result<(), Error> { | 547 | async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]) -> Result<(), Error> { |
| 558 | self.transfer(rx, tx).await | 548 | self.transfer(rx, tx).await |
| 559 | } | 549 | } |
| 560 | 550 | ||
| 561 | async fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Error> { | 551 | async fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Error> { |
| 562 | self.transfer_in_place(words).await | 552 | self.transfer_in_place(words).await |
| 563 | } | ||
| 564 | } | 553 | } |
| 565 | } | 554 | } |
| 566 | 555 | ||
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs index 919bb4ab2..da8e15d02 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs | |||
| @@ -810,81 +810,72 @@ mod eh02 { | |||
| 810 | } | 810 | } |
| 811 | } | 811 | } |
| 812 | 812 | ||
| 813 | #[cfg(feature = "unstable-traits")] | 813 | impl embedded_hal_1::i2c::Error for Error { |
| 814 | mod eh1 { | 814 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { |
| 815 | use super::*; | 815 | match *self { |
| 816 | 816 | Self::TxBufferTooLong => embedded_hal_1::i2c::ErrorKind::Other, | |
| 817 | impl embedded_hal_1::i2c::Error for Error { | 817 | Self::RxBufferTooLong => embedded_hal_1::i2c::ErrorKind::Other, |
| 818 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { | 818 | Self::Transmit => embedded_hal_1::i2c::ErrorKind::Other, |
| 819 | match *self { | 819 | Self::Receive => embedded_hal_1::i2c::ErrorKind::Other, |
| 820 | Self::TxBufferTooLong => embedded_hal_1::i2c::ErrorKind::Other, | 820 | Self::BufferNotInRAM => embedded_hal_1::i2c::ErrorKind::Other, |
| 821 | Self::RxBufferTooLong => embedded_hal_1::i2c::ErrorKind::Other, | 821 | Self::AddressNack => { |
| 822 | Self::Transmit => embedded_hal_1::i2c::ErrorKind::Other, | 822 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Address) |
| 823 | Self::Receive => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 824 | Self::BufferNotInRAM => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 825 | Self::AddressNack => { | ||
| 826 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Address) | ||
| 827 | } | ||
| 828 | Self::DataNack => { | ||
| 829 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Data) | ||
| 830 | } | ||
| 831 | Self::Overrun => embedded_hal_1::i2c::ErrorKind::Overrun, | ||
| 832 | Self::Timeout => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 833 | } | 823 | } |
| 824 | Self::DataNack => { | ||
| 825 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Data) | ||
| 826 | } | ||
| 827 | Self::Overrun => embedded_hal_1::i2c::ErrorKind::Overrun, | ||
| 828 | Self::Timeout => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 834 | } | 829 | } |
| 835 | } | 830 | } |
| 831 | } | ||
| 836 | 832 | ||
| 837 | impl<'d, T: Instance> embedded_hal_1::i2c::ErrorType for Twim<'d, T> { | 833 | impl<'d, T: Instance> embedded_hal_1::i2c::ErrorType for Twim<'d, T> { |
| 838 | type Error = Error; | 834 | type Error = Error; |
| 839 | } | 835 | } |
| 840 | 836 | ||
| 841 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for Twim<'d, T> { | 837 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for Twim<'d, T> { |
| 842 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 838 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 843 | self.blocking_read(address, buffer) | 839 | self.blocking_read(address, buffer) |
| 844 | } | 840 | } |
| 845 | 841 | ||
| 846 | fn write(&mut self, address: u8, buffer: &[u8]) -> Result<(), Self::Error> { | 842 | fn write(&mut self, address: u8, buffer: &[u8]) -> Result<(), Self::Error> { |
| 847 | self.blocking_write(address, buffer) | 843 | self.blocking_write(address, buffer) |
| 848 | } | 844 | } |
| 849 | 845 | ||
| 850 | fn write_read(&mut self, address: u8, wr_buffer: &[u8], rd_buffer: &mut [u8]) -> Result<(), Self::Error> { | 846 | fn write_read(&mut self, address: u8, wr_buffer: &[u8], rd_buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 851 | self.blocking_write_read(address, wr_buffer, rd_buffer) | 847 | self.blocking_write_read(address, wr_buffer, rd_buffer) |
| 852 | } | 848 | } |
| 853 | 849 | ||
| 854 | fn transaction<'a>( | 850 | fn transaction<'a>( |
| 855 | &mut self, | 851 | &mut self, |
| 856 | _address: u8, | 852 | _address: u8, |
| 857 | _operations: &mut [embedded_hal_1::i2c::Operation<'a>], | 853 | _operations: &mut [embedded_hal_1::i2c::Operation<'a>], |
| 858 | ) -> Result<(), Self::Error> { | 854 | ) -> Result<(), Self::Error> { |
| 859 | todo!(); | 855 | todo!(); |
| 860 | } | ||
| 861 | } | 856 | } |
| 862 | } | 857 | } |
| 863 | 858 | ||
| 864 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 859 | impl<'d, T: Instance> embedded_hal_async::i2c::I2c for Twim<'d, T> { |
| 865 | mod eha { | 860 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { |
| 866 | use super::*; | 861 | self.read(address, read).await |
| 867 | impl<'d, T: Instance> embedded_hal_async::i2c::I2c for Twim<'d, T> { | 862 | } |
| 868 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { | ||
| 869 | self.read(address, read).await | ||
| 870 | } | ||
| 871 | 863 | ||
| 872 | async fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { | 864 | async fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { |
| 873 | self.write(address, write).await | 865 | self.write(address, write).await |
| 874 | } | 866 | } |
| 875 | async fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 867 | async fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 876 | self.write_read(address, write, read).await | 868 | self.write_read(address, write, read).await |
| 877 | } | 869 | } |
| 878 | 870 | ||
| 879 | async fn transaction( | 871 | async fn transaction( |
| 880 | &mut self, | 872 | &mut self, |
| 881 | address: u8, | 873 | address: u8, |
| 882 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], | 874 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 883 | ) -> Result<(), Self::Error> { | 875 | ) -> Result<(), Self::Error> { |
| 884 | let _ = address; | 876 | let _ = address; |
| 885 | let _ = operations; | 877 | let _ = operations; |
| 886 | todo!() | 878 | todo!() |
| 887 | } | ||
| 888 | } | 879 | } |
| 889 | } | 880 | } |
| 890 | 881 | ||
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 35ea77f03..1a2945a7e 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [package.metadata.embassy_docs] | 7 | [package.metadata.embassy_docs] |
| 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-rp-v$VERSION/embassy-rp/src/" | 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-rp-v$VERSION/embassy-rp/src/" |
| 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-rp/src/" | 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-rp/src/" |
| 10 | features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "time-driver"] | 10 | features = ["defmt", "unstable-pac", "time-driver"] |
| 11 | flavors = [ | 11 | flavors = [ |
| 12 | { name = "rp2040", target = "thumbv6m-none-eabi" }, | 12 | { name = "rp2040", target = "thumbv6m-none-eabi" }, |
| 13 | ] | 13 | ] |
| @@ -16,7 +16,7 @@ flavors = [ | |||
| 16 | default = [ "rt" ] | 16 | default = [ "rt" ] |
| 17 | rt = [ "rp-pac/rt" ] | 17 | rt = [ "rp-pac/rt" ] |
| 18 | 18 | ||
| 19 | defmt = ["dep:defmt", "embassy-usb-driver?/defmt", "embassy-hal-internal/defmt"] | 19 | defmt = ["dep:defmt", "embassy-usb-driver/defmt", "embassy-hal-internal/defmt"] |
| 20 | 20 | ||
| 21 | # critical section that is safe for multicore use | 21 | # critical section that is safe for multicore use |
| 22 | critical-section-impl = ["critical-section/restore-state-u8"] | 22 | critical-section-impl = ["critical-section/restore-state-u8"] |
| @@ -51,20 +51,13 @@ qspi-as-gpio = [] | |||
| 51 | # This allows the flash driver to not force pausing execution on both cores when doing flash operations. | 51 | # This allows the flash driver to not force pausing execution on both cores when doing flash operations. |
| 52 | run-from-ram = [] | 52 | run-from-ram = [] |
| 53 | 53 | ||
| 54 | # Enable nightly-only features | ||
| 55 | nightly = ["embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "embassy-embedded-hal/nightly", "dep:embassy-usb-driver", "dep:embedded-io-async"] | ||
| 56 | |||
| 57 | # Implement embedded-hal 1.0 alpha traits. | ||
| 58 | # Implement embedded-hal-async traits if `nightly` is set as well. | ||
| 59 | unstable-traits = ["embedded-hal-1", "embedded-hal-nb"] | ||
| 60 | |||
| 61 | [dependencies] | 54 | [dependencies] |
| 62 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } | 55 | embassy-sync = { version = "0.4.0", path = "../embassy-sync" } |
| 63 | embassy-time = { version = "0.1.5", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } | 56 | embassy-time = { version = "0.1.5", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } |
| 64 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 57 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 65 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] } | 58 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] } |
| 66 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 59 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
| 67 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true } | 60 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver" } |
| 68 | atomic-polyfill = "1.0.1" | 61 | atomic-polyfill = "1.0.1" |
| 69 | defmt = { version = "0.3", optional = true } | 62 | defmt = { version = "0.3", optional = true } |
| 70 | log = { version = "0.4.14", optional = true } | 63 | log = { version = "0.4.14", optional = true } |
| @@ -76,18 +69,18 @@ critical-section = "1.1" | |||
| 76 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 69 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 77 | chrono = { version = "0.4", default-features = false, optional = true } | 70 | chrono = { version = "0.4", default-features = false, optional = true } |
| 78 | embedded-io = { version = "0.6.0" } | 71 | embedded-io = { version = "0.6.0" } |
| 79 | embedded-io-async = { version = "0.6.1", optional = true } | 72 | embedded-io-async = { version = "0.6.1" } |
| 80 | embedded-storage = { version = "0.3" } | 73 | embedded-storage = { version = "0.3" } |
| 81 | embedded-storage-async = { version = "0.4.0", optional = true } | 74 | embedded-storage-async = { version = "0.4.0" } |
| 82 | rand_core = "0.6.4" | 75 | rand_core = "0.6.4" |
| 83 | fixed = "1.23.1" | 76 | fixed = "1.23.1" |
| 84 | 77 | ||
| 85 | rp-pac = { version = "6" } | 78 | rp-pac = { version = "6" } |
| 86 | 79 | ||
| 87 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 80 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 88 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2", optional = true} | 81 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 89 | embedded-hal-async = { version = "=1.0.0-rc.2", optional = true} | 82 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 90 | embedded-hal-nb = { version = "=1.0.0-rc.2", optional = true} | 83 | embedded-hal-nb = { version = "=1.0.0-rc.2" } |
| 91 | 84 | ||
| 92 | pio-proc = {version= "0.2" } | 85 | pio-proc = {version= "0.2" } |
| 93 | pio = {version= "0.2.1" } | 86 | pio = {version= "0.2.1" } |
diff --git a/embassy-rp/src/flash.rs b/embassy-rp/src/flash.rs index 8fb5542f1..1b20561da 100644 --- a/embassy-rp/src/flash.rs +++ b/embassy-rp/src/flash.rs | |||
| @@ -352,7 +352,6 @@ impl<'d, T: Instance, M: Mode, const FLASH_SIZE: usize> NorFlash for Flash<'d, T | |||
| 352 | } | 352 | } |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | #[cfg(feature = "nightly")] | ||
| 356 | impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash::ReadNorFlash | 355 | impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash::ReadNorFlash |
| 357 | for Flash<'d, T, Async, FLASH_SIZE> | 356 | for Flash<'d, T, Async, FLASH_SIZE> |
| 358 | { | 357 | { |
| @@ -367,7 +366,6 @@ impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash | |||
| 367 | } | 366 | } |
| 368 | } | 367 | } |
| 369 | 368 | ||
| 370 | #[cfg(feature = "nightly")] | ||
| 371 | impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash::NorFlash | 369 | impl<'d, T: Instance, const FLASH_SIZE: usize> embedded_storage_async::nor_flash::NorFlash |
| 372 | for Flash<'d, T, Async, FLASH_SIZE> | 370 | for Flash<'d, T, Async, FLASH_SIZE> |
| 373 | { | 371 | { |
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index ee7e03e95..9034f3f36 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | use core::convert::Infallible; | ||
| 2 | use core::future::Future; | 3 | use core::future::Future; |
| 3 | use core::pin::Pin as FuturePin; | 4 | use core::pin::Pin as FuturePin; |
| 4 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| @@ -1036,217 +1037,207 @@ mod eh02 { | |||
| 1036 | } | 1037 | } |
| 1037 | } | 1038 | } |
| 1038 | 1039 | ||
| 1039 | #[cfg(feature = "unstable-traits")] | 1040 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { |
| 1040 | mod eh1 { | 1041 | type Error = Infallible; |
| 1041 | use core::convert::Infallible; | 1042 | } |
| 1042 | 1043 | ||
| 1043 | use super::*; | 1044 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { |
| 1045 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 1046 | Ok(self.is_high()) | ||
| 1047 | } | ||
| 1044 | 1048 | ||
| 1045 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { | 1049 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 1046 | type Error = Infallible; | 1050 | Ok(self.is_low()) |
| 1047 | } | 1051 | } |
| 1052 | } | ||
| 1048 | 1053 | ||
| 1049 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { | 1054 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Output<'d, T> { |
| 1050 | fn is_high(&self) -> Result<bool, Self::Error> { | 1055 | type Error = Infallible; |
| 1051 | Ok(self.is_high()) | 1056 | } |
| 1052 | } | ||
| 1053 | 1057 | ||
| 1054 | fn is_low(&self) -> Result<bool, Self::Error> { | 1058 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { |
| 1055 | Ok(self.is_low()) | 1059 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 1056 | } | 1060 | Ok(self.set_high()) |
| 1057 | } | 1061 | } |
| 1058 | 1062 | ||
| 1059 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Output<'d, T> { | 1063 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 1060 | type Error = Infallible; | 1064 | Ok(self.set_low()) |
| 1061 | } | 1065 | } |
| 1066 | } | ||
| 1062 | 1067 | ||
| 1063 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { | 1068 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { |
| 1064 | fn set_high(&mut self) -> Result<(), Self::Error> { | 1069 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 1065 | Ok(self.set_high()) | 1070 | Ok(self.is_set_high()) |
| 1066 | } | ||
| 1067 | |||
| 1068 | fn set_low(&mut self) -> Result<(), Self::Error> { | ||
| 1069 | Ok(self.set_low()) | ||
| 1070 | } | ||
| 1071 | } | 1071 | } |
| 1072 | 1072 | ||
| 1073 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { | 1073 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 1074 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 1074 | Ok(self.is_set_low()) |
| 1075 | Ok(self.is_set_high()) | 1075 | } |
| 1076 | } | 1076 | } |
| 1077 | 1077 | ||
| 1078 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 1078 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Output<'d, T> { |
| 1079 | Ok(self.is_set_low()) | 1079 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 1080 | } | 1080 | Ok(self.toggle()) |
| 1081 | } | 1081 | } |
| 1082 | } | ||
| 1082 | 1083 | ||
| 1083 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Output<'d, T> { | 1084 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for OutputOpenDrain<'d, T> { |
| 1084 | fn toggle(&mut self) -> Result<(), Self::Error> { | 1085 | type Error = Infallible; |
| 1085 | Ok(self.toggle()) | 1086 | } |
| 1086 | } | 1087 | |
| 1088 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for OutputOpenDrain<'d, T> { | ||
| 1089 | fn set_high(&mut self) -> Result<(), Self::Error> { | ||
| 1090 | Ok(self.set_high()) | ||
| 1087 | } | 1091 | } |
| 1088 | 1092 | ||
| 1089 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for OutputOpenDrain<'d, T> { | 1093 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 1090 | type Error = Infallible; | 1094 | Ok(self.set_low()) |
| 1091 | } | 1095 | } |
| 1096 | } | ||
| 1092 | 1097 | ||
| 1093 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for OutputOpenDrain<'d, T> { | 1098 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for OutputOpenDrain<'d, T> { |
| 1094 | fn set_high(&mut self) -> Result<(), Self::Error> { | 1099 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 1095 | Ok(self.set_high()) | 1100 | Ok(self.is_set_high()) |
| 1096 | } | 1101 | } |
| 1097 | 1102 | ||
| 1098 | fn set_low(&mut self) -> Result<(), Self::Error> { | 1103 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 1099 | Ok(self.set_low()) | 1104 | Ok(self.is_set_low()) |
| 1100 | } | ||
| 1101 | } | 1105 | } |
| 1106 | } | ||
| 1102 | 1107 | ||
| 1103 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for OutputOpenDrain<'d, T> { | 1108 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for OutputOpenDrain<'d, T> { |
| 1104 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 1109 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 1105 | Ok(self.is_set_high()) | 1110 | Ok(self.toggle()) |
| 1106 | } | 1111 | } |
| 1112 | } | ||
| 1107 | 1113 | ||
| 1108 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 1114 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for OutputOpenDrain<'d, T> { |
| 1109 | Ok(self.is_set_low()) | 1115 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 1110 | } | 1116 | Ok(self.is_high()) |
| 1111 | } | 1117 | } |
| 1112 | 1118 | ||
| 1113 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for OutputOpenDrain<'d, T> { | 1119 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 1114 | fn toggle(&mut self) -> Result<(), Self::Error> { | 1120 | Ok(self.is_low()) |
| 1115 | Ok(self.toggle()) | ||
| 1116 | } | ||
| 1117 | } | 1121 | } |
| 1122 | } | ||
| 1118 | 1123 | ||
| 1119 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for OutputOpenDrain<'d, T> { | 1124 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Flex<'d, T> { |
| 1120 | fn is_high(&self) -> Result<bool, Self::Error> { | 1125 | type Error = Infallible; |
| 1121 | Ok(self.is_high()) | 1126 | } |
| 1122 | } | ||
| 1123 | 1127 | ||
| 1124 | fn is_low(&self) -> Result<bool, Self::Error> { | 1128 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { |
| 1125 | Ok(self.is_low()) | 1129 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 1126 | } | 1130 | Ok(self.is_high()) |
| 1127 | } | 1131 | } |
| 1128 | 1132 | ||
| 1129 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Flex<'d, T> { | 1133 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 1130 | type Error = Infallible; | 1134 | Ok(self.is_low()) |
| 1131 | } | 1135 | } |
| 1136 | } | ||
| 1132 | 1137 | ||
| 1133 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { | 1138 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { |
| 1134 | fn is_high(&self) -> Result<bool, Self::Error> { | 1139 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 1135 | Ok(self.is_high()) | 1140 | Ok(self.set_high()) |
| 1136 | } | ||
| 1137 | |||
| 1138 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 1139 | Ok(self.is_low()) | ||
| 1140 | } | ||
| 1141 | } | 1141 | } |
| 1142 | 1142 | ||
| 1143 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { | 1143 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 1144 | fn set_high(&mut self) -> Result<(), Self::Error> { | 1144 | Ok(self.set_low()) |
| 1145 | Ok(self.set_high()) | ||
| 1146 | } | ||
| 1147 | |||
| 1148 | fn set_low(&mut self) -> Result<(), Self::Error> { | ||
| 1149 | Ok(self.set_low()) | ||
| 1150 | } | ||
| 1151 | } | 1145 | } |
| 1146 | } | ||
| 1152 | 1147 | ||
| 1153 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { | 1148 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { |
| 1154 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 1149 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 1155 | Ok(self.is_set_high()) | 1150 | Ok(self.is_set_high()) |
| 1156 | } | 1151 | } |
| 1157 | 1152 | ||
| 1158 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 1153 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 1159 | Ok(self.is_set_low()) | 1154 | Ok(self.is_set_low()) |
| 1160 | } | ||
| 1161 | } | 1155 | } |
| 1156 | } | ||
| 1162 | 1157 | ||
| 1163 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Flex<'d, T> { | 1158 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Flex<'d, T> { |
| 1164 | fn toggle(&mut self) -> Result<(), Self::Error> { | 1159 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 1165 | Ok(self.toggle()) | 1160 | Ok(self.toggle()) |
| 1166 | } | ||
| 1167 | } | 1161 | } |
| 1162 | } | ||
| 1168 | 1163 | ||
| 1169 | #[cfg(feature = "nightly")] | 1164 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Flex<'d, T> { |
| 1170 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Flex<'d, T> { | 1165 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { |
| 1171 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | 1166 | self.wait_for_high().await; |
| 1172 | self.wait_for_high().await; | 1167 | Ok(()) |
| 1173 | Ok(()) | 1168 | } |
| 1174 | } | ||
| 1175 | 1169 | ||
| 1176 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 1170 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 1177 | self.wait_for_low().await; | 1171 | self.wait_for_low().await; |
| 1178 | Ok(()) | 1172 | Ok(()) |
| 1179 | } | 1173 | } |
| 1180 | 1174 | ||
| 1181 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 1175 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 1182 | self.wait_for_rising_edge().await; | 1176 | self.wait_for_rising_edge().await; |
| 1183 | Ok(()) | 1177 | Ok(()) |
| 1184 | } | 1178 | } |
| 1185 | 1179 | ||
| 1186 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 1180 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 1187 | self.wait_for_falling_edge().await; | 1181 | self.wait_for_falling_edge().await; |
| 1188 | Ok(()) | 1182 | Ok(()) |
| 1189 | } | 1183 | } |
| 1190 | 1184 | ||
| 1191 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 1185 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 1192 | self.wait_for_any_edge().await; | 1186 | self.wait_for_any_edge().await; |
| 1193 | Ok(()) | 1187 | Ok(()) |
| 1194 | } | ||
| 1195 | } | 1188 | } |
| 1189 | } | ||
| 1196 | 1190 | ||
| 1197 | #[cfg(feature = "nightly")] | 1191 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Input<'d, T> { |
| 1198 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for Input<'d, T> { | 1192 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { |
| 1199 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | 1193 | self.wait_for_high().await; |
| 1200 | self.wait_for_high().await; | 1194 | Ok(()) |
| 1201 | Ok(()) | 1195 | } |
| 1202 | } | ||
| 1203 | 1196 | ||
| 1204 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 1197 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 1205 | self.wait_for_low().await; | 1198 | self.wait_for_low().await; |
| 1206 | Ok(()) | 1199 | Ok(()) |
| 1207 | } | 1200 | } |
| 1208 | 1201 | ||
| 1209 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 1202 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 1210 | self.wait_for_rising_edge().await; | 1203 | self.wait_for_rising_edge().await; |
| 1211 | Ok(()) | 1204 | Ok(()) |
| 1212 | } | 1205 | } |
| 1213 | 1206 | ||
| 1214 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 1207 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 1215 | self.wait_for_falling_edge().await; | 1208 | self.wait_for_falling_edge().await; |
| 1216 | Ok(()) | 1209 | Ok(()) |
| 1217 | } | 1210 | } |
| 1218 | 1211 | ||
| 1219 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 1212 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 1220 | self.wait_for_any_edge().await; | 1213 | self.wait_for_any_edge().await; |
| 1221 | Ok(()) | 1214 | Ok(()) |
| 1222 | } | ||
| 1223 | } | 1215 | } |
| 1216 | } | ||
| 1224 | 1217 | ||
| 1225 | #[cfg(feature = "nightly")] | 1218 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for OutputOpenDrain<'d, T> { |
| 1226 | impl<'d, T: Pin> embedded_hal_async::digital::Wait for OutputOpenDrain<'d, T> { | 1219 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { |
| 1227 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | 1220 | self.wait_for_high().await; |
| 1228 | self.wait_for_high().await; | 1221 | Ok(()) |
| 1229 | Ok(()) | 1222 | } |
| 1230 | } | ||
| 1231 | 1223 | ||
| 1232 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 1224 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 1233 | self.wait_for_low().await; | 1225 | self.wait_for_low().await; |
| 1234 | Ok(()) | 1226 | Ok(()) |
| 1235 | } | 1227 | } |
| 1236 | 1228 | ||
| 1237 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 1229 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 1238 | self.wait_for_rising_edge().await; | 1230 | self.wait_for_rising_edge().await; |
| 1239 | Ok(()) | 1231 | Ok(()) |
| 1240 | } | 1232 | } |
| 1241 | 1233 | ||
| 1242 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 1234 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 1243 | self.wait_for_falling_edge().await; | 1235 | self.wait_for_falling_edge().await; |
| 1244 | Ok(()) | 1236 | Ok(()) |
| 1245 | } | 1237 | } |
| 1246 | 1238 | ||
| 1247 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 1239 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 1248 | self.wait_for_any_edge().await; | 1240 | self.wait_for_any_edge().await; |
| 1249 | Ok(()) | 1241 | Ok(()) |
| 1250 | } | ||
| 1251 | } | 1242 | } |
| 1252 | } | 1243 | } |
diff --git a/embassy-rp/src/i2c.rs b/embassy-rp/src/i2c.rs index 4fe4b27eb..15095236a 100644 --- a/embassy-rp/src/i2c.rs +++ b/embassy-rp/src/i2c.rs | |||
| @@ -588,167 +588,157 @@ impl<'d, T: Instance + 'd, M: Mode> I2c<'d, T, M> { | |||
| 588 | } | 588 | } |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | mod eh02 { | 591 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Read for I2c<'d, T, M> { |
| 592 | use super::*; | 592 | type Error = Error; |
| 593 | 593 | ||
| 594 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Read for I2c<'d, T, M> { | 594 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 595 | type Error = Error; | 595 | self.blocking_read(address, buffer) |
| 596 | |||
| 597 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | ||
| 598 | self.blocking_read(address, buffer) | ||
| 599 | } | ||
| 600 | } | 596 | } |
| 597 | } | ||
| 601 | 598 | ||
| 602 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Write for I2c<'d, T, M> { | 599 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Write for I2c<'d, T, M> { |
| 603 | type Error = Error; | 600 | type Error = Error; |
| 604 | 601 | ||
| 605 | fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error> { | 602 | fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error> { |
| 606 | self.blocking_write(address, bytes) | 603 | self.blocking_write(address, bytes) |
| 607 | } | ||
| 608 | } | 604 | } |
| 605 | } | ||
| 609 | 606 | ||
| 610 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::WriteRead for I2c<'d, T, M> { | 607 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::WriteRead for I2c<'d, T, M> { |
| 611 | type Error = Error; | 608 | type Error = Error; |
| 612 | 609 | ||
| 613 | fn write_read(&mut self, address: u8, bytes: &[u8], buffer: &mut [u8]) -> Result<(), Self::Error> { | 610 | fn write_read(&mut self, address: u8, bytes: &[u8], buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 614 | self.blocking_write_read(address, bytes, buffer) | 611 | self.blocking_write_read(address, bytes, buffer) |
| 615 | } | ||
| 616 | } | 612 | } |
| 613 | } | ||
| 617 | 614 | ||
| 618 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Transactional for I2c<'d, T, M> { | 615 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::i2c::Transactional for I2c<'d, T, M> { |
| 619 | type Error = Error; | 616 | type Error = Error; |
| 620 | 617 | ||
| 621 | fn exec( | 618 | fn exec( |
| 622 | &mut self, | 619 | &mut self, |
| 623 | address: u8, | 620 | address: u8, |
| 624 | operations: &mut [embedded_hal_02::blocking::i2c::Operation<'_>], | 621 | operations: &mut [embedded_hal_02::blocking::i2c::Operation<'_>], |
| 625 | ) -> Result<(), Self::Error> { | 622 | ) -> Result<(), Self::Error> { |
| 626 | Self::setup(address.into())?; | 623 | Self::setup(address.into())?; |
| 627 | for i in 0..operations.len() { | 624 | for i in 0..operations.len() { |
| 628 | let last = i == operations.len() - 1; | 625 | let last = i == operations.len() - 1; |
| 629 | match &mut operations[i] { | 626 | match &mut operations[i] { |
| 630 | embedded_hal_02::blocking::i2c::Operation::Read(buf) => { | 627 | embedded_hal_02::blocking::i2c::Operation::Read(buf) => { |
| 631 | self.read_blocking_internal(buf, false, last)? | 628 | self.read_blocking_internal(buf, false, last)? |
| 632 | } | ||
| 633 | embedded_hal_02::blocking::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, | ||
| 634 | } | 629 | } |
| 630 | embedded_hal_02::blocking::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, | ||
| 635 | } | 631 | } |
| 636 | Ok(()) | ||
| 637 | } | 632 | } |
| 633 | Ok(()) | ||
| 638 | } | 634 | } |
| 639 | } | 635 | } |
| 640 | 636 | ||
| 641 | #[cfg(feature = "unstable-traits")] | 637 | impl embedded_hal_1::i2c::Error for Error { |
| 642 | mod eh1 { | 638 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { |
| 643 | use super::*; | 639 | match *self { |
| 644 | 640 | Self::Abort(AbortReason::ArbitrationLoss) => embedded_hal_1::i2c::ErrorKind::ArbitrationLoss, | |
| 645 | impl embedded_hal_1::i2c::Error for Error { | 641 | Self::Abort(AbortReason::NoAcknowledge) => { |
| 646 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { | 642 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Address) |
| 647 | match *self { | ||
| 648 | Self::Abort(AbortReason::ArbitrationLoss) => embedded_hal_1::i2c::ErrorKind::ArbitrationLoss, | ||
| 649 | Self::Abort(AbortReason::NoAcknowledge) => { | ||
| 650 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Address) | ||
| 651 | } | ||
| 652 | Self::Abort(AbortReason::TxNotEmpty(_)) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 653 | Self::Abort(AbortReason::Other(_)) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 654 | Self::InvalidReadBufferLength => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 655 | Self::InvalidWriteBufferLength => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 656 | Self::AddressOutOfRange(_) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 657 | Self::AddressReserved(_) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 658 | } | 643 | } |
| 644 | Self::Abort(AbortReason::TxNotEmpty(_)) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 645 | Self::Abort(AbortReason::Other(_)) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 646 | Self::InvalidReadBufferLength => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 647 | Self::InvalidWriteBufferLength => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 648 | Self::AddressOutOfRange(_) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 649 | Self::AddressReserved(_) => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 659 | } | 650 | } |
| 660 | } | 651 | } |
| 652 | } | ||
| 661 | 653 | ||
| 662 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::ErrorType for I2c<'d, T, M> { | 654 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::ErrorType for I2c<'d, T, M> { |
| 663 | type Error = Error; | 655 | type Error = Error; |
| 664 | } | 656 | } |
| 665 | 657 | ||
| 666 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::I2c for I2c<'d, T, M> { | 658 | impl<'d, T: Instance, M: Mode> embedded_hal_1::i2c::I2c for I2c<'d, T, M> { |
| 667 | fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { | 659 | fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { |
| 668 | self.blocking_read(address, read) | 660 | self.blocking_read(address, read) |
| 669 | } | 661 | } |
| 670 | 662 | ||
| 671 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { | 663 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { |
| 672 | self.blocking_write(address, write) | 664 | self.blocking_write(address, write) |
| 673 | } | 665 | } |
| 674 | 666 | ||
| 675 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 667 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 676 | self.blocking_write_read(address, write, read) | 668 | self.blocking_write_read(address, write, read) |
| 677 | } | 669 | } |
| 678 | 670 | ||
| 679 | fn transaction( | 671 | fn transaction( |
| 680 | &mut self, | 672 | &mut self, |
| 681 | address: u8, | 673 | address: u8, |
| 682 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], | 674 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 683 | ) -> Result<(), Self::Error> { | 675 | ) -> Result<(), Self::Error> { |
| 684 | Self::setup(address.into())?; | 676 | Self::setup(address.into())?; |
| 685 | for i in 0..operations.len() { | 677 | for i in 0..operations.len() { |
| 686 | let last = i == operations.len() - 1; | 678 | let last = i == operations.len() - 1; |
| 687 | match &mut operations[i] { | 679 | match &mut operations[i] { |
| 688 | embedded_hal_1::i2c::Operation::Read(buf) => self.read_blocking_internal(buf, false, last)?, | 680 | embedded_hal_1::i2c::Operation::Read(buf) => self.read_blocking_internal(buf, false, last)?, |
| 689 | embedded_hal_1::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, | 681 | embedded_hal_1::i2c::Operation::Write(buf) => self.write_blocking_internal(buf, last)?, |
| 690 | } | ||
| 691 | } | 682 | } |
| 692 | Ok(()) | ||
| 693 | } | 683 | } |
| 684 | Ok(()) | ||
| 694 | } | 685 | } |
| 695 | } | 686 | } |
| 696 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | ||
| 697 | mod nightly { | ||
| 698 | use embedded_hal_1::i2c::Operation; | ||
| 699 | use embedded_hal_async::i2c::AddressMode; | ||
| 700 | 687 | ||
| 701 | use super::*; | 688 | impl<'d, A, T> embedded_hal_async::i2c::I2c<A> for I2c<'d, T, Async> |
| 689 | where | ||
| 690 | A: embedded_hal_async::i2c::AddressMode + Into<u16> + 'static, | ||
| 691 | T: Instance + 'd, | ||
| 692 | { | ||
| 693 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> { | ||
| 694 | let addr: u16 = address.into(); | ||
| 702 | 695 | ||
| 703 | impl<'d, A, T> embedded_hal_async::i2c::I2c<A> for I2c<'d, T, Async> | 696 | Self::setup(addr)?; |
| 704 | where | 697 | self.read_async_internal(read, false, true).await |
| 705 | A: AddressMode + Into<u16> + 'static, | 698 | } |
| 706 | T: Instance + 'd, | ||
| 707 | { | ||
| 708 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> { | ||
| 709 | let addr: u16 = address.into(); | ||
| 710 | 699 | ||
| 711 | Self::setup(addr)?; | 700 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> { |
| 712 | self.read_async_internal(read, false, true).await | 701 | let addr: u16 = address.into(); |
| 713 | } | ||
| 714 | 702 | ||
| 715 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> { | 703 | Self::setup(addr)?; |
| 716 | let addr: u16 = address.into(); | 704 | self.write_async_internal(write.iter().copied(), true).await |
| 705 | } | ||
| 717 | 706 | ||
| 718 | Self::setup(addr)?; | 707 | async fn write_read(&mut self, address: A, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 719 | self.write_async_internal(write.iter().copied(), true).await | 708 | let addr: u16 = address.into(); |
| 720 | } | ||
| 721 | 709 | ||
| 722 | async fn write_read(&mut self, address: A, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 710 | Self::setup(addr)?; |
| 723 | let addr: u16 = address.into(); | 711 | self.write_async_internal(write.iter().cloned(), false).await?; |
| 712 | self.read_async_internal(read, true, true).await | ||
| 713 | } | ||
| 724 | 714 | ||
| 725 | Self::setup(addr)?; | 715 | async fn transaction( |
| 726 | self.write_async_internal(write.iter().cloned(), false).await?; | 716 | &mut self, |
| 727 | self.read_async_internal(read, true, true).await | 717 | address: A, |
| 728 | } | 718 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 719 | ) -> Result<(), Self::Error> { | ||
| 720 | use embedded_hal_1::i2c::Operation; | ||
| 729 | 721 | ||
| 730 | async fn transaction(&mut self, address: A, operations: &mut [Operation<'_>]) -> Result<(), Self::Error> { | 722 | let addr: u16 = address.into(); |
| 731 | let addr: u16 = address.into(); | ||
| 732 | 723 | ||
| 733 | if operations.len() > 0 { | 724 | if operations.len() > 0 { |
| 734 | Self::setup(addr)?; | 725 | Self::setup(addr)?; |
| 735 | } | 726 | } |
| 736 | let mut iterator = operations.iter_mut(); | 727 | let mut iterator = operations.iter_mut(); |
| 737 | 728 | ||
| 738 | while let Some(op) = iterator.next() { | 729 | while let Some(op) = iterator.next() { |
| 739 | let last = iterator.len() == 0; | 730 | let last = iterator.len() == 0; |
| 740 | 731 | ||
| 741 | match op { | 732 | match op { |
| 742 | Operation::Read(buffer) => { | 733 | Operation::Read(buffer) => { |
| 743 | self.read_async_internal(buffer, false, last).await?; | 734 | self.read_async_internal(buffer, false, last).await?; |
| 744 | } | 735 | } |
| 745 | Operation::Write(buffer) => { | 736 | Operation::Write(buffer) => { |
| 746 | self.write_async_internal(buffer.into_iter().cloned(), last).await?; | 737 | self.write_async_internal(buffer.into_iter().cloned(), last).await?; |
| 747 | } | ||
| 748 | } | 738 | } |
| 749 | } | 739 | } |
| 750 | Ok(()) | ||
| 751 | } | 740 | } |
| 741 | Ok(()) | ||
| 752 | } | 742 | } |
| 753 | } | 743 | } |
| 754 | 744 | ||
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index c9fe89b8c..66e4cfdcf 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | ||
| 4 | 3 | ||
| 5 | // This mod MUST go first, so that the others see its macros. | 4 | // This mod MUST go first, so that the others see its macros. |
| 6 | pub(crate) mod fmt; | 5 | pub(crate) mod fmt; |
| @@ -28,7 +27,6 @@ pub mod spi; | |||
| 28 | #[cfg(feature = "time-driver")] | 27 | #[cfg(feature = "time-driver")] |
| 29 | pub mod timer; | 28 | pub mod timer; |
| 30 | pub mod uart; | 29 | pub mod uart; |
| 31 | #[cfg(feature = "nightly")] | ||
| 32 | pub mod usb; | 30 | pub mod usb; |
| 33 | pub mod watchdog; | 31 | pub mod watchdog; |
| 34 | 32 | ||
diff --git a/embassy-rp/src/spi.rs b/embassy-rp/src/spi.rs index a59ce8419..6ba985a65 100644 --- a/embassy-rp/src/spi.rs +++ b/embassy-rp/src/spi.rs | |||
| @@ -511,87 +511,73 @@ impl_mode!(Async); | |||
| 511 | 511 | ||
| 512 | // ==================== | 512 | // ==================== |
| 513 | 513 | ||
| 514 | mod eh02 { | 514 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::spi::Transfer<u8> for Spi<'d, T, M> { |
| 515 | use super::*; | 515 | type Error = Error; |
| 516 | 516 | fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error> { | |
| 517 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::spi::Transfer<u8> for Spi<'d, T, M> { | 517 | self.blocking_transfer_in_place(words)?; |
| 518 | type Error = Error; | 518 | Ok(words) |
| 519 | fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error> { | ||
| 520 | self.blocking_transfer_in_place(words)?; | ||
| 521 | Ok(words) | ||
| 522 | } | ||
| 523 | } | 519 | } |
| 520 | } | ||
| 524 | 521 | ||
| 525 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::spi::Write<u8> for Spi<'d, T, M> { | 522 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::spi::Write<u8> for Spi<'d, T, M> { |
| 526 | type Error = Error; | 523 | type Error = Error; |
| 527 | 524 | ||
| 528 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 525 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 529 | self.blocking_write(words) | 526 | self.blocking_write(words) |
| 530 | } | ||
| 531 | } | 527 | } |
| 532 | } | 528 | } |
| 533 | 529 | ||
| 534 | #[cfg(feature = "unstable-traits")] | 530 | impl embedded_hal_1::spi::Error for Error { |
| 535 | mod eh1 { | 531 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { |
| 536 | use super::*; | 532 | match *self {} |
| 537 | |||
| 538 | impl embedded_hal_1::spi::Error for Error { | ||
| 539 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { | ||
| 540 | match *self {} | ||
| 541 | } | ||
| 542 | } | 533 | } |
| 534 | } | ||
| 543 | 535 | ||
| 544 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::ErrorType for Spi<'d, T, M> { | 536 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::ErrorType for Spi<'d, T, M> { |
| 545 | type Error = Error; | 537 | type Error = Error; |
| 546 | } | 538 | } |
| 547 | 539 | ||
| 548 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBus<u8> for Spi<'d, T, M> { | 540 | impl<'d, T: Instance, M: Mode> embedded_hal_1::spi::SpiBus<u8> for Spi<'d, T, M> { |
| 549 | fn flush(&mut self) -> Result<(), Self::Error> { | 541 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 550 | Ok(()) | 542 | Ok(()) |
| 551 | } | 543 | } |
| 552 | 544 | ||
| 553 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 545 | fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 554 | self.blocking_transfer(words, &[]) | 546 | self.blocking_transfer(words, &[]) |
| 555 | } | 547 | } |
| 556 | 548 | ||
| 557 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 549 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 558 | self.blocking_write(words) | 550 | self.blocking_write(words) |
| 559 | } | 551 | } |
| 560 | 552 | ||
| 561 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { | 553 | fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { |
| 562 | self.blocking_transfer(read, write) | 554 | self.blocking_transfer(read, write) |
| 563 | } | 555 | } |
| 564 | 556 | ||
| 565 | fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 557 | fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 566 | self.blocking_transfer_in_place(words) | 558 | self.blocking_transfer_in_place(words) |
| 567 | } | ||
| 568 | } | 559 | } |
| 569 | } | 560 | } |
| 570 | 561 | ||
| 571 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 562 | impl<'d, T: Instance> embedded_hal_async::spi::SpiBus<u8> for Spi<'d, T, Async> { |
| 572 | mod eha { | 563 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 573 | use super::*; | 564 | Ok(()) |
| 574 | 565 | } | |
| 575 | impl<'d, T: Instance> embedded_hal_async::spi::SpiBus<u8> for Spi<'d, T, Async> { | ||
| 576 | async fn flush(&mut self) -> Result<(), Self::Error> { | ||
| 577 | Ok(()) | ||
| 578 | } | ||
| 579 | 566 | ||
| 580 | async fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | 567 | async fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { |
| 581 | self.write(words).await | 568 | self.write(words).await |
| 582 | } | 569 | } |
| 583 | 570 | ||
| 584 | async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 571 | async fn read(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 585 | self.read(words).await | 572 | self.read(words).await |
| 586 | } | 573 | } |
| 587 | 574 | ||
| 588 | async fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { | 575 | async fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> { |
| 589 | self.transfer(read, write).await | 576 | self.transfer(read, write).await |
| 590 | } | 577 | } |
| 591 | 578 | ||
| 592 | async fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { | 579 | async fn transfer_in_place(&mut self, words: &mut [u8]) -> Result<(), Self::Error> { |
| 593 | self.transfer_in_place(words).await | 580 | self.transfer_in_place(words).await |
| 594 | } | ||
| 595 | } | 581 | } |
| 596 | } | 582 | } |
| 597 | 583 | ||
diff --git a/embassy-rp/src/uart/buffered.rs b/embassy-rp/src/uart/buffered.rs index 9f638761d..ca030f560 100644 --- a/embassy-rp/src/uart/buffered.rs +++ b/embassy-rp/src/uart/buffered.rs | |||
| @@ -668,126 +668,117 @@ impl<'d, T: Instance + 'd> embedded_io::Write for BufferedUartTx<'d, T> { | |||
| 668 | } | 668 | } |
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | mod eh02 { | 671 | impl<'d, T: Instance> embedded_hal_02::serial::Read<u8> for BufferedUartRx<'d, T> { |
| 672 | use super::*; | 672 | type Error = Error; |
| 673 | 673 | ||
| 674 | impl<'d, T: Instance> embedded_hal_02::serial::Read<u8> for BufferedUartRx<'d, T> { | 674 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 675 | type Error = Error; | 675 | let r = T::regs(); |
| 676 | if r.uartfr().read().rxfe() { | ||
| 677 | return Err(nb::Error::WouldBlock); | ||
| 678 | } | ||
| 676 | 679 | ||
| 677 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 680 | let dr = r.uartdr().read(); |
| 678 | let r = T::regs(); | ||
| 679 | if r.uartfr().read().rxfe() { | ||
| 680 | return Err(nb::Error::WouldBlock); | ||
| 681 | } | ||
| 682 | 681 | ||
| 683 | let dr = r.uartdr().read(); | 682 | if dr.oe() { |
| 684 | 683 | Err(nb::Error::Other(Error::Overrun)) | |
| 685 | if dr.oe() { | 684 | } else if dr.be() { |
| 686 | Err(nb::Error::Other(Error::Overrun)) | 685 | Err(nb::Error::Other(Error::Break)) |
| 687 | } else if dr.be() { | 686 | } else if dr.pe() { |
| 688 | Err(nb::Error::Other(Error::Break)) | 687 | Err(nb::Error::Other(Error::Parity)) |
| 689 | } else if dr.pe() { | 688 | } else if dr.fe() { |
| 690 | Err(nb::Error::Other(Error::Parity)) | 689 | Err(nb::Error::Other(Error::Framing)) |
| 691 | } else if dr.fe() { | 690 | } else { |
| 692 | Err(nb::Error::Other(Error::Framing)) | 691 | Ok(dr.data()) |
| 693 | } else { | ||
| 694 | Ok(dr.data()) | ||
| 695 | } | ||
| 696 | } | 692 | } |
| 697 | } | 693 | } |
| 694 | } | ||
| 698 | 695 | ||
| 699 | impl<'d, T: Instance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUartTx<'d, T> { | 696 | impl<'d, T: Instance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUartTx<'d, T> { |
| 700 | type Error = Error; | 697 | type Error = Error; |
| 701 | 698 | ||
| 702 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { | 699 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { |
| 703 | while !buffer.is_empty() { | 700 | while !buffer.is_empty() { |
| 704 | match self.blocking_write(buffer) { | 701 | match self.blocking_write(buffer) { |
| 705 | Ok(0) => panic!("zero-length write."), | 702 | Ok(0) => panic!("zero-length write."), |
| 706 | Ok(n) => buffer = &buffer[n..], | 703 | Ok(n) => buffer = &buffer[n..], |
| 707 | Err(e) => return Err(e), | 704 | Err(e) => return Err(e), |
| 708 | } | ||
| 709 | } | 705 | } |
| 710 | Ok(()) | ||
| 711 | } | 706 | } |
| 707 | Ok(()) | ||
| 708 | } | ||
| 712 | 709 | ||
| 713 | fn bflush(&mut self) -> Result<(), Self::Error> { | 710 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 714 | self.blocking_flush() | 711 | self.blocking_flush() |
| 715 | } | ||
| 716 | } | 712 | } |
| 713 | } | ||
| 717 | 714 | ||
| 718 | impl<'d, T: Instance> embedded_hal_02::serial::Read<u8> for BufferedUart<'d, T> { | 715 | impl<'d, T: Instance> embedded_hal_02::serial::Read<u8> for BufferedUart<'d, T> { |
| 719 | type Error = Error; | 716 | type Error = Error; |
| 720 | 717 | ||
| 721 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 718 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 722 | embedded_hal_02::serial::Read::read(&mut self.rx) | 719 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 723 | } | ||
| 724 | } | 720 | } |
| 721 | } | ||
| 725 | 722 | ||
| 726 | impl<'d, T: Instance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUart<'d, T> { | 723 | impl<'d, T: Instance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUart<'d, T> { |
| 727 | type Error = Error; | 724 | type Error = Error; |
| 728 | 725 | ||
| 729 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { | 726 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { |
| 730 | while !buffer.is_empty() { | 727 | while !buffer.is_empty() { |
| 731 | match self.blocking_write(buffer) { | 728 | match self.blocking_write(buffer) { |
| 732 | Ok(0) => panic!("zero-length write."), | 729 | Ok(0) => panic!("zero-length write."), |
| 733 | Ok(n) => buffer = &buffer[n..], | 730 | Ok(n) => buffer = &buffer[n..], |
| 734 | Err(e) => return Err(e), | 731 | Err(e) => return Err(e), |
| 735 | } | ||
| 736 | } | 732 | } |
| 737 | Ok(()) | ||
| 738 | } | 733 | } |
| 734 | Ok(()) | ||
| 735 | } | ||
| 739 | 736 | ||
| 740 | fn bflush(&mut self) -> Result<(), Self::Error> { | 737 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 741 | self.blocking_flush() | 738 | self.blocking_flush() |
| 742 | } | ||
| 743 | } | 739 | } |
| 744 | } | 740 | } |
| 745 | 741 | ||
| 746 | #[cfg(feature = "unstable-traits")] | 742 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUartRx<'d, T> { |
| 747 | mod eh1 { | 743 | type Error = Error; |
| 748 | use super::*; | 744 | } |
| 749 | 745 | ||
| 750 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUartRx<'d, T> { | 746 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUartTx<'d, T> { |
| 751 | type Error = Error; | 747 | type Error = Error; |
| 752 | } | 748 | } |
| 753 | 749 | ||
| 754 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUartTx<'d, T> { | 750 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUart<'d, T> { |
| 755 | type Error = Error; | 751 | type Error = Error; |
| 756 | } | 752 | } |
| 757 | 753 | ||
| 758 | impl<'d, T: Instance> embedded_hal_nb::serial::ErrorType for BufferedUart<'d, T> { | 754 | impl<'d, T: Instance> embedded_hal_nb::serial::Read for BufferedUartRx<'d, T> { |
| 759 | type Error = Error; | 755 | fn read(&mut self) -> nb::Result<u8, Self::Error> { |
| 756 | embedded_hal_02::serial::Read::read(self) | ||
| 760 | } | 757 | } |
| 758 | } | ||
| 761 | 759 | ||
| 762 | impl<'d, T: Instance> embedded_hal_nb::serial::Read for BufferedUartRx<'d, T> { | 760 | impl<'d, T: Instance> embedded_hal_nb::serial::Write for BufferedUartTx<'d, T> { |
| 763 | fn read(&mut self) -> nb::Result<u8, Self::Error> { | 761 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 764 | embedded_hal_02::serial::Read::read(self) | 762 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) |
| 765 | } | ||
| 766 | } | 763 | } |
| 767 | 764 | ||
| 768 | impl<'d, T: Instance> embedded_hal_nb::serial::Write for BufferedUartTx<'d, T> { | 765 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 769 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 766 | self.blocking_flush().map_err(nb::Error::Other) |
| 770 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) | ||
| 771 | } | ||
| 772 | |||
| 773 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | ||
| 774 | self.blocking_flush().map_err(nb::Error::Other) | ||
| 775 | } | ||
| 776 | } | 767 | } |
| 768 | } | ||
| 777 | 769 | ||
| 778 | impl<'d, T: Instance> embedded_hal_nb::serial::Read for BufferedUart<'d, T> { | 770 | impl<'d, T: Instance> embedded_hal_nb::serial::Read for BufferedUart<'d, T> { |
| 779 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 771 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 780 | embedded_hal_02::serial::Read::read(&mut self.rx) | 772 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 781 | } | ||
| 782 | } | 773 | } |
| 774 | } | ||
| 783 | 775 | ||
| 784 | impl<'d, T: Instance> embedded_hal_nb::serial::Write for BufferedUart<'d, T> { | 776 | impl<'d, T: Instance> embedded_hal_nb::serial::Write for BufferedUart<'d, T> { |
| 785 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 777 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 786 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) | 778 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) |
| 787 | } | 779 | } |
| 788 | 780 | ||
| 789 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | 781 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 790 | self.blocking_flush().map_err(nb::Error::Other) | 782 | self.blocking_flush().map_err(nb::Error::Other) |
| 791 | } | ||
| 792 | } | 783 | } |
| 793 | } | 784 | } |
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 461986c81..18705b141 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -17,9 +17,7 @@ use crate::interrupt::typelevel::{Binding, Interrupt}; | |||
| 17 | use crate::pac::io::vals::{Inover, Outover}; | 17 | use crate::pac::io::vals::{Inover, Outover}; |
| 18 | use crate::{interrupt, pac, peripherals, Peripheral, RegExt}; | 18 | use crate::{interrupt, pac, peripherals, Peripheral, RegExt}; |
| 19 | 19 | ||
| 20 | #[cfg(feature = "nightly")] | ||
| 21 | mod buffered; | 20 | mod buffered; |
| 22 | #[cfg(feature = "nightly")] | ||
| 23 | pub use buffered::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, BufferedUartTx}; | 21 | pub use buffered::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, BufferedUartTx}; |
| 24 | 22 | ||
| 25 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] | 23 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
| @@ -193,7 +191,6 @@ impl<'d, T: Instance, M: Mode> UartTx<'d, T, M> { | |||
| 193 | } | 191 | } |
| 194 | 192 | ||
| 195 | impl<'d, T: Instance> UartTx<'d, T, Blocking> { | 193 | impl<'d, T: Instance> UartTx<'d, T, Blocking> { |
| 196 | #[cfg(feature = "nightly")] | ||
| 197 | pub fn into_buffered( | 194 | pub fn into_buffered( |
| 198 | self, | 195 | self, |
| 199 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, | 196 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, |
| @@ -307,7 +304,6 @@ impl<'d, T: Instance> UartRx<'d, T, Blocking> { | |||
| 307 | Self::new_inner(false, None) | 304 | Self::new_inner(false, None) |
| 308 | } | 305 | } |
| 309 | 306 | ||
| 310 | #[cfg(feature = "nightly")] | ||
| 311 | pub fn into_buffered( | 307 | pub fn into_buffered( |
| 312 | self, | 308 | self, |
| 313 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, | 309 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, |
| @@ -462,7 +458,6 @@ impl<'d, T: Instance> Uart<'d, T, Blocking> { | |||
| 462 | ) | 458 | ) |
| 463 | } | 459 | } |
| 464 | 460 | ||
| 465 | #[cfg(feature = "nightly")] | ||
| 466 | pub fn into_buffered( | 461 | pub fn into_buffered( |
| 467 | self, | 462 | self, |
| 468 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, | 463 | irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, |
| @@ -709,172 +704,163 @@ impl<'d, T: Instance> Uart<'d, T, Async> { | |||
| 709 | } | 704 | } |
| 710 | } | 705 | } |
| 711 | 706 | ||
| 712 | mod eh02 { | 707 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Read<u8> for UartRx<'d, T, M> { |
| 713 | use super::*; | 708 | type Error = Error; |
| 714 | 709 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | |
| 715 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Read<u8> for UartRx<'d, T, M> { | 710 | let r = T::regs(); |
| 716 | type Error = Error; | 711 | if r.uartfr().read().rxfe() { |
| 717 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 712 | return Err(nb::Error::WouldBlock); |
| 718 | let r = T::regs(); | 713 | } |
| 719 | if r.uartfr().read().rxfe() { | ||
| 720 | return Err(nb::Error::WouldBlock); | ||
| 721 | } | ||
| 722 | 714 | ||
| 723 | let dr = r.uartdr().read(); | 715 | let dr = r.uartdr().read(); |
| 724 | 716 | ||
| 725 | if dr.oe() { | 717 | if dr.oe() { |
| 726 | Err(nb::Error::Other(Error::Overrun)) | 718 | Err(nb::Error::Other(Error::Overrun)) |
| 727 | } else if dr.be() { | 719 | } else if dr.be() { |
| 728 | Err(nb::Error::Other(Error::Break)) | 720 | Err(nb::Error::Other(Error::Break)) |
| 729 | } else if dr.pe() { | 721 | } else if dr.pe() { |
| 730 | Err(nb::Error::Other(Error::Parity)) | 722 | Err(nb::Error::Other(Error::Parity)) |
| 731 | } else if dr.fe() { | 723 | } else if dr.fe() { |
| 732 | Err(nb::Error::Other(Error::Framing)) | 724 | Err(nb::Error::Other(Error::Framing)) |
| 733 | } else { | 725 | } else { |
| 734 | Ok(dr.data()) | 726 | Ok(dr.data()) |
| 735 | } | ||
| 736 | } | 727 | } |
| 737 | } | 728 | } |
| 729 | } | ||
| 738 | 730 | ||
| 739 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Write<u8> for UartTx<'d, T, M> { | 731 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Write<u8> for UartTx<'d, T, M> { |
| 740 | type Error = Error; | 732 | type Error = Error; |
| 741 | |||
| 742 | fn write(&mut self, word: u8) -> Result<(), nb::Error<Self::Error>> { | ||
| 743 | let r = T::regs(); | ||
| 744 | if r.uartfr().read().txff() { | ||
| 745 | return Err(nb::Error::WouldBlock); | ||
| 746 | } | ||
| 747 | 733 | ||
| 748 | r.uartdr().write(|w| w.set_data(word)); | 734 | fn write(&mut self, word: u8) -> Result<(), nb::Error<Self::Error>> { |
| 749 | Ok(()) | 735 | let r = T::regs(); |
| 736 | if r.uartfr().read().txff() { | ||
| 737 | return Err(nb::Error::WouldBlock); | ||
| 750 | } | 738 | } |
| 751 | 739 | ||
| 752 | fn flush(&mut self) -> Result<(), nb::Error<Self::Error>> { | 740 | r.uartdr().write(|w| w.set_data(word)); |
| 753 | let r = T::regs(); | 741 | Ok(()) |
| 754 | if !r.uartfr().read().txfe() { | ||
| 755 | return Err(nb::Error::WouldBlock); | ||
| 756 | } | ||
| 757 | Ok(()) | ||
| 758 | } | ||
| 759 | } | 742 | } |
| 760 | 743 | ||
| 761 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::serial::Write<u8> for UartTx<'d, T, M> { | 744 | fn flush(&mut self) -> Result<(), nb::Error<Self::Error>> { |
| 762 | type Error = Error; | 745 | let r = T::regs(); |
| 763 | 746 | if !r.uartfr().read().txfe() { | |
| 764 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 747 | return Err(nb::Error::WouldBlock); |
| 765 | self.blocking_write(buffer) | ||
| 766 | } | ||
| 767 | |||
| 768 | fn bflush(&mut self) -> Result<(), Self::Error> { | ||
| 769 | self.blocking_flush() | ||
| 770 | } | 748 | } |
| 749 | Ok(()) | ||
| 771 | } | 750 | } |
| 751 | } | ||
| 772 | 752 | ||
| 773 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Read<u8> for Uart<'d, T, M> { | 753 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::serial::Write<u8> for UartTx<'d, T, M> { |
| 774 | type Error = Error; | 754 | type Error = Error; |
| 775 | 755 | ||
| 776 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 756 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 777 | embedded_hal_02::serial::Read::read(&mut self.rx) | 757 | self.blocking_write(buffer) |
| 778 | } | ||
| 779 | } | 758 | } |
| 780 | 759 | ||
| 781 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Write<u8> for Uart<'d, T, M> { | 760 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 782 | type Error = Error; | 761 | self.blocking_flush() |
| 762 | } | ||
| 763 | } | ||
| 783 | 764 | ||
| 784 | fn write(&mut self, word: u8) -> Result<(), nb::Error<Self::Error>> { | 765 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Read<u8> for Uart<'d, T, M> { |
| 785 | embedded_hal_02::serial::Write::write(&mut self.tx, word) | 766 | type Error = Error; |
| 786 | } | ||
| 787 | 767 | ||
| 788 | fn flush(&mut self) -> Result<(), nb::Error<Self::Error>> { | 768 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 789 | embedded_hal_02::serial::Write::flush(&mut self.tx) | 769 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 790 | } | ||
| 791 | } | 770 | } |
| 771 | } | ||
| 792 | 772 | ||
| 793 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::serial::Write<u8> for Uart<'d, T, M> { | 773 | impl<'d, T: Instance, M: Mode> embedded_hal_02::serial::Write<u8> for Uart<'d, T, M> { |
| 794 | type Error = Error; | 774 | type Error = Error; |
| 795 | 775 | ||
| 796 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 776 | fn write(&mut self, word: u8) -> Result<(), nb::Error<Self::Error>> { |
| 797 | self.blocking_write(buffer) | 777 | embedded_hal_02::serial::Write::write(&mut self.tx, word) |
| 798 | } | 778 | } |
| 799 | 779 | ||
| 800 | fn bflush(&mut self) -> Result<(), Self::Error> { | 780 | fn flush(&mut self) -> Result<(), nb::Error<Self::Error>> { |
| 801 | self.blocking_flush() | 781 | embedded_hal_02::serial::Write::flush(&mut self.tx) |
| 802 | } | ||
| 803 | } | 782 | } |
| 804 | } | 783 | } |
| 805 | 784 | ||
| 806 | #[cfg(feature = "unstable-traits")] | 785 | impl<'d, T: Instance, M: Mode> embedded_hal_02::blocking::serial::Write<u8> for Uart<'d, T, M> { |
| 807 | mod eh1 { | 786 | type Error = Error; |
| 808 | use super::*; | ||
| 809 | 787 | ||
| 810 | impl embedded_hal_nb::serial::Error for Error { | 788 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 811 | fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { | 789 | self.blocking_write(buffer) |
| 812 | match *self { | ||
| 813 | Self::Framing => embedded_hal_nb::serial::ErrorKind::FrameFormat, | ||
| 814 | Self::Break => embedded_hal_nb::serial::ErrorKind::Other, | ||
| 815 | Self::Overrun => embedded_hal_nb::serial::ErrorKind::Overrun, | ||
| 816 | Self::Parity => embedded_hal_nb::serial::ErrorKind::Parity, | ||
| 817 | } | ||
| 818 | } | ||
| 819 | } | 790 | } |
| 820 | 791 | ||
| 821 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartRx<'d, T, M> { | 792 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 822 | type Error = Error; | 793 | self.blocking_flush() |
| 823 | } | 794 | } |
| 795 | } | ||
| 824 | 796 | ||
| 825 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartTx<'d, T, M> { | 797 | impl embedded_hal_nb::serial::Error for Error { |
| 826 | type Error = Error; | 798 | fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { |
| 799 | match *self { | ||
| 800 | Self::Framing => embedded_hal_nb::serial::ErrorKind::FrameFormat, | ||
| 801 | Self::Break => embedded_hal_nb::serial::ErrorKind::Other, | ||
| 802 | Self::Overrun => embedded_hal_nb::serial::ErrorKind::Overrun, | ||
| 803 | Self::Parity => embedded_hal_nb::serial::ErrorKind::Parity, | ||
| 804 | } | ||
| 827 | } | 805 | } |
| 806 | } | ||
| 828 | 807 | ||
| 829 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for Uart<'d, T, M> { | 808 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartRx<'d, T, M> { |
| 830 | type Error = Error; | 809 | type Error = Error; |
| 831 | } | 810 | } |
| 832 | 811 | ||
| 833 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for UartRx<'d, T, M> { | 812 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartTx<'d, T, M> { |
| 834 | fn read(&mut self) -> nb::Result<u8, Self::Error> { | 813 | type Error = Error; |
| 835 | let r = T::regs(); | 814 | } |
| 836 | let dr = r.uartdr().read(); | ||
| 837 | 815 | ||
| 838 | if dr.oe() { | 816 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for Uart<'d, T, M> { |
| 839 | Err(nb::Error::Other(Error::Overrun)) | 817 | type Error = Error; |
| 840 | } else if dr.be() { | 818 | } |
| 841 | Err(nb::Error::Other(Error::Break)) | 819 | |
| 842 | } else if dr.pe() { | 820 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for UartRx<'d, T, M> { |
| 843 | Err(nb::Error::Other(Error::Parity)) | 821 | fn read(&mut self) -> nb::Result<u8, Self::Error> { |
| 844 | } else if dr.fe() { | 822 | let r = T::regs(); |
| 845 | Err(nb::Error::Other(Error::Framing)) | 823 | let dr = r.uartdr().read(); |
| 846 | } else if dr.fe() { | 824 | |
| 847 | Ok(dr.data()) | 825 | if dr.oe() { |
| 848 | } else { | 826 | Err(nb::Error::Other(Error::Overrun)) |
| 849 | Err(nb::Error::WouldBlock) | 827 | } else if dr.be() { |
| 850 | } | 828 | Err(nb::Error::Other(Error::Break)) |
| 829 | } else if dr.pe() { | ||
| 830 | Err(nb::Error::Other(Error::Parity)) | ||
| 831 | } else if dr.fe() { | ||
| 832 | Err(nb::Error::Other(Error::Framing)) | ||
| 833 | } else if dr.fe() { | ||
| 834 | Ok(dr.data()) | ||
| 835 | } else { | ||
| 836 | Err(nb::Error::WouldBlock) | ||
| 851 | } | 837 | } |
| 852 | } | 838 | } |
| 839 | } | ||
| 853 | 840 | ||
| 854 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for UartTx<'d, T, M> { | 841 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for UartTx<'d, T, M> { |
| 855 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 842 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 856 | self.blocking_write(&[char]).map_err(nb::Error::Other) | 843 | self.blocking_write(&[char]).map_err(nb::Error::Other) |
| 857 | } | 844 | } |
| 858 | 845 | ||
| 859 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | 846 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 860 | self.blocking_flush().map_err(nb::Error::Other) | 847 | self.blocking_flush().map_err(nb::Error::Other) |
| 861 | } | ||
| 862 | } | 848 | } |
| 849 | } | ||
| 863 | 850 | ||
| 864 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for Uart<'d, T, M> { | 851 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Read for Uart<'d, T, M> { |
| 865 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 852 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 866 | embedded_hal_02::serial::Read::read(&mut self.rx) | 853 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 867 | } | ||
| 868 | } | 854 | } |
| 855 | } | ||
| 869 | 856 | ||
| 870 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for Uart<'d, T, M> { | 857 | impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for Uart<'d, T, M> { |
| 871 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 858 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 872 | self.blocking_write(&[char]).map_err(nb::Error::Other) | 859 | self.blocking_write(&[char]).map_err(nb::Error::Other) |
| 873 | } | 860 | } |
| 874 | 861 | ||
| 875 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | 862 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 876 | self.blocking_flush().map_err(nb::Error::Other) | 863 | self.blocking_flush().map_err(nb::Error::Other) |
| 877 | } | ||
| 878 | } | 864 | } |
| 879 | } | 865 | } |
| 880 | 866 | ||
| @@ -891,7 +877,6 @@ mod sealed { | |||
| 891 | 877 | ||
| 892 | fn regs() -> pac::uart::Uart; | 878 | fn regs() -> pac::uart::Uart; |
| 893 | 879 | ||
| 894 | #[cfg(feature = "nightly")] | ||
| 895 | fn buffered_state() -> &'static buffered::State; | 880 | fn buffered_state() -> &'static buffered::State; |
| 896 | 881 | ||
| 897 | fn dma_state() -> &'static DmaState; | 882 | fn dma_state() -> &'static DmaState; |
| @@ -931,7 +916,6 @@ macro_rules! impl_instance { | |||
| 931 | pac::$inst | 916 | pac::$inst |
| 932 | } | 917 | } |
| 933 | 918 | ||
| 934 | #[cfg(feature = "nightly")] | ||
| 935 | fn buffered_state() -> &'static buffered::State { | 919 | fn buffered_state() -> &'static buffered::State { |
| 936 | static STATE: buffered::State = buffered::State::new(); | 920 | static STATE: buffered::State = buffered::State::new(); |
| 937 | &STATE | 921 | &STATE |
diff --git a/embassy-stm32-wpan/src/lib.rs b/embassy-stm32-wpan/src/lib.rs index 84cf0a02d..a5dbb7420 100644 --- a/embassy-stm32-wpan/src/lib.rs +++ b/embassy-stm32-wpan/src/lib.rs | |||
| @@ -1,9 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![cfg_attr(any(feature = "ble", feature = "mac"), feature(async_fn_in_trait))] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![cfg_attr( | ||
| 4 | any(feature = "ble", feature = "mac"), | ||
| 5 | allow(stable_features, unknown_lints, async_fn_in_trait) | ||
| 6 | )] | ||
| 7 | 3 | ||
| 8 | // This must go FIRST so that all the other modules see its macros. | 4 | // This must go FIRST so that all the other modules see its macros. |
| 9 | mod fmt; | 5 | mod fmt; |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 535357fcc..0ef603059 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-v$VERSION/embassy-stm32/src/" | 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-v$VERSION/embassy-stm32/src/" |
| 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32/src/" | 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32/src/" |
| 10 | 10 | ||
| 11 | features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "time"] | 11 | features = ["defmt", "unstable-pac", "exti", "time-driver-any", "time"] |
| 12 | flavors = [ | 12 | flavors = [ |
| 13 | { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" }, | 13 | { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" }, |
| 14 | { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" }, | 14 | { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" }, |
| @@ -38,16 +38,16 @@ embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | |||
| 38 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] } | 38 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] } |
| 39 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 39 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
| 40 | embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" } | 40 | embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" } |
| 41 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true } | 41 | embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver" } |
| 42 | embassy-executor = { version = "0.3.3", path = "../embassy-executor", optional = true } | 42 | embassy-executor = { version = "0.3.3", path = "../embassy-executor", optional = true } |
| 43 | 43 | ||
| 44 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 44 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 45 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2", optional = true} | 45 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 46 | embedded-hal-async = { version = "=1.0.0-rc.2", optional = true} | 46 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 47 | embedded-hal-nb = { version = "=1.0.0-rc.2", optional = true} | 47 | embedded-hal-nb = { version = "=1.0.0-rc.2" } |
| 48 | 48 | ||
| 49 | embedded-storage = "0.3.0" | 49 | embedded-storage = "0.3.0" |
| 50 | embedded-storage-async = { version = "0.4.0", optional = true } | 50 | embedded-storage-async = { version = "0.4.0" } |
| 51 | 51 | ||
| 52 | defmt = { version = "0.3", optional = true } | 52 | defmt = { version = "0.3", optional = true } |
| 53 | log = { version = "0.4.14", optional = true } | 53 | log = { version = "0.4.14", optional = true } |
| @@ -65,7 +65,7 @@ nb = "1.0.0" | |||
| 65 | stm32-fmc = "0.3.0" | 65 | stm32-fmc = "0.3.0" |
| 66 | cfg-if = "1.0.0" | 66 | cfg-if = "1.0.0" |
| 67 | embedded-io = { version = "0.6.0" } | 67 | embedded-io = { version = "0.6.0" } |
| 68 | embedded-io-async = { version = "0.6.1", optional = true } | 68 | embedded-io-async = { version = "0.6.1" } |
| 69 | chrono = { version = "^0.4", default-features = false, optional = true} | 69 | chrono = { version = "^0.4", default-features = false, optional = true} |
| 70 | bit_field = "0.10.2" | 70 | bit_field = "0.10.2" |
| 71 | document-features = "0.2.7" | 71 | document-features = "0.2.7" |
| @@ -86,29 +86,21 @@ default = ["rt"] | |||
| 86 | rt = ["stm32-metapac/rt"] | 86 | rt = ["stm32-metapac/rt"] |
| 87 | 87 | ||
| 88 | ## Use [`defmt`](https://docs.rs/defmt/latest/defmt/) for logging | 88 | ## Use [`defmt`](https://docs.rs/defmt/latest/defmt/) for logging |
| 89 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-embedded-hal/defmt", "embassy-hal-internal/defmt", "embedded-io-async?/defmt-03", "embassy-usb-driver?/defmt", "embassy-net-driver/defmt", "embassy-time?/defmt"] | 89 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-embedded-hal/defmt", "embassy-hal-internal/defmt", "embedded-io-async/defmt-03", "embassy-usb-driver/defmt", "embassy-net-driver/defmt", "embassy-time?/defmt"] |
| 90 | 90 | ||
| 91 | exti = [] | 91 | exti = [] |
| 92 | low-power = [ "dep:embassy-executor", "embassy-executor/arch-cortex-m" ] | 92 | low-power = [ "dep:embassy-executor", "embassy-executor?/arch-cortex-m" ] |
| 93 | low-power-debug-with-sleep = [] | 93 | low-power-debug-with-sleep = [] |
| 94 | embassy-executor = [] | ||
| 95 | 94 | ||
| 96 | ## Automatically generate `memory.x` file using [`stm32-metapac`](https://docs.rs/stm32-metapac/) | 95 | ## Automatically generate `memory.x` file using [`stm32-metapac`](https://docs.rs/stm32-metapac/) |
| 97 | memory-x = ["stm32-metapac/memory-x"] | 96 | memory-x = ["stm32-metapac/memory-x"] |
| 98 | 97 | ||
| 99 | ## Enable nightly-only features | ||
| 100 | nightly = ["embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io-async", "dep:embassy-usb-driver", "embassy-embedded-hal/nightly"] | ||
| 101 | |||
| 102 | ## Re-export stm32-metapac at `embassy_stm32::pac`. | 98 | ## Re-export stm32-metapac at `embassy_stm32::pac`. |
| 103 | ## This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version. | 99 | ## This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version. |
| 104 | ## If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. | 100 | ## If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. |
| 105 | ## There are no plans to make this stable. | 101 | ## There are no plans to make this stable. |
| 106 | unstable-pac = [] | 102 | unstable-pac = [] |
| 107 | 103 | ||
| 108 | ## Implement embedded-hal 1.0 alpha traits. | ||
| 109 | ## Implement embedded-hal-async traits if `nightly` is set as well. | ||
| 110 | unstable-traits = ["embedded-hal-1", "dep:embedded-hal-nb"] | ||
| 111 | |||
| 112 | #! ## Time | 104 | #! ## Time |
| 113 | 105 | ||
| 114 | ## Enables additional driver features that depend on embassy-time | 106 | ## Enables additional driver features that depend on embassy-time |
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs index 07c63a2ef..dbd24804f 100644 --- a/embassy-stm32/src/exti.rs +++ b/embassy-stm32/src/exti.rs | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | use core::convert::Infallible; | ||
| 1 | use core::future::Future; | 2 | use core::future::Future; |
| 2 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 3 | use core::pin::Pin; | 4 | use core::pin::Pin; |
| @@ -137,74 +138,56 @@ impl<'d, T: GpioPin> ExtiInput<'d, T> { | |||
| 137 | } | 138 | } |
| 138 | } | 139 | } |
| 139 | 140 | ||
| 140 | mod eh02 { | 141 | impl<'d, T: GpioPin> embedded_hal_02::digital::v2::InputPin for ExtiInput<'d, T> { |
| 141 | use core::convert::Infallible; | 142 | type Error = Infallible; |
| 142 | 143 | ||
| 143 | use super::*; | 144 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 144 | 145 | Ok(self.is_high()) | |
| 145 | impl<'d, T: GpioPin> embedded_hal_02::digital::v2::InputPin for ExtiInput<'d, T> { | 146 | } |
| 146 | type Error = Infallible; | ||
| 147 | |||
| 148 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 149 | Ok(self.is_high()) | ||
| 150 | } | ||
| 151 | 147 | ||
| 152 | fn is_low(&self) -> Result<bool, Self::Error> { | 148 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 153 | Ok(self.is_low()) | 149 | Ok(self.is_low()) |
| 154 | } | ||
| 155 | } | 150 | } |
| 156 | } | 151 | } |
| 157 | 152 | ||
| 158 | #[cfg(feature = "unstable-traits")] | 153 | impl<'d, T: GpioPin> embedded_hal_1::digital::ErrorType for ExtiInput<'d, T> { |
| 159 | mod eh1 { | 154 | type Error = Infallible; |
| 160 | use core::convert::Infallible; | 155 | } |
| 161 | |||
| 162 | use super::*; | ||
| 163 | 156 | ||
| 164 | impl<'d, T: GpioPin> embedded_hal_1::digital::ErrorType for ExtiInput<'d, T> { | 157 | impl<'d, T: GpioPin> embedded_hal_1::digital::InputPin for ExtiInput<'d, T> { |
| 165 | type Error = Infallible; | 158 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 159 | Ok(self.is_high()) | ||
| 166 | } | 160 | } |
| 167 | 161 | ||
| 168 | impl<'d, T: GpioPin> embedded_hal_1::digital::InputPin for ExtiInput<'d, T> { | 162 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 169 | fn is_high(&self) -> Result<bool, Self::Error> { | 163 | Ok(self.is_low()) |
| 170 | Ok(self.is_high()) | ||
| 171 | } | ||
| 172 | |||
| 173 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 174 | Ok(self.is_low()) | ||
| 175 | } | ||
| 176 | } | 164 | } |
| 177 | } | 165 | } |
| 178 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | ||
| 179 | mod eha { | ||
| 180 | 166 | ||
| 181 | use super::*; | 167 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for ExtiInput<'d, T> { |
| 182 | 168 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | |
| 183 | impl<'d, T: GpioPin> embedded_hal_async::digital::Wait for ExtiInput<'d, T> { | 169 | self.wait_for_high().await; |
| 184 | async fn wait_for_high(&mut self) -> Result<(), Self::Error> { | 170 | Ok(()) |
| 185 | self.wait_for_high().await; | 171 | } |
| 186 | Ok(()) | ||
| 187 | } | ||
| 188 | 172 | ||
| 189 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { | 173 | async fn wait_for_low(&mut self) -> Result<(), Self::Error> { |
| 190 | self.wait_for_low().await; | 174 | self.wait_for_low().await; |
| 191 | Ok(()) | 175 | Ok(()) |
| 192 | } | 176 | } |
| 193 | 177 | ||
| 194 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { | 178 | async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> { |
| 195 | self.wait_for_rising_edge().await; | 179 | self.wait_for_rising_edge().await; |
| 196 | Ok(()) | 180 | Ok(()) |
| 197 | } | 181 | } |
| 198 | 182 | ||
| 199 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { | 183 | async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> { |
| 200 | self.wait_for_falling_edge().await; | 184 | self.wait_for_falling_edge().await; |
| 201 | Ok(()) | 185 | Ok(()) |
| 202 | } | 186 | } |
| 203 | 187 | ||
| 204 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { | 188 | async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> { |
| 205 | self.wait_for_any_edge().await; | 189 | self.wait_for_any_edge().await; |
| 206 | Ok(()) | 190 | Ok(()) |
| 207 | } | ||
| 208 | } | 191 | } |
| 209 | } | 192 | } |
| 210 | 193 | ||
diff --git a/embassy-stm32/src/flash/asynch.rs b/embassy-stm32/src/flash/asynch.rs index e966e2a77..eae40c7ec 100644 --- a/embassy-stm32/src/flash/asynch.rs +++ b/embassy-stm32/src/flash/asynch.rs | |||
| @@ -55,7 +55,6 @@ impl interrupt::typelevel::Handler<crate::interrupt::typelevel::FLASH> for Inter | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | #[cfg(feature = "nightly")] | ||
| 59 | impl embedded_storage_async::nor_flash::ReadNorFlash for Flash<'_, Async> { | 58 | impl embedded_storage_async::nor_flash::ReadNorFlash for Flash<'_, Async> { |
| 60 | const READ_SIZE: usize = super::READ_SIZE; | 59 | const READ_SIZE: usize = super::READ_SIZE; |
| 61 | 60 | ||
| @@ -68,7 +67,6 @@ impl embedded_storage_async::nor_flash::ReadNorFlash for Flash<'_, Async> { | |||
| 68 | } | 67 | } |
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | #[cfg(feature = "nightly")] | ||
| 72 | impl embedded_storage_async::nor_flash::NorFlash for Flash<'_, Async> { | 70 | impl embedded_storage_async::nor_flash::NorFlash for Flash<'_, Async> { |
| 73 | const WRITE_SIZE: usize = WRITE_SIZE; | 71 | const WRITE_SIZE: usize = WRITE_SIZE; |
| 74 | const ERASE_SIZE: usize = super::MAX_ERASE_SIZE; | 72 | const ERASE_SIZE: usize = super::MAX_ERASE_SIZE; |
| @@ -158,8 +156,7 @@ foreach_flash_region! { | |||
| 158 | } | 156 | } |
| 159 | } | 157 | } |
| 160 | 158 | ||
| 161 | #[cfg(feature = "nightly")] | 159 | impl embedded_storage_async::nor_flash::ReadNorFlash for crate::_generated::flash_regions::$type_name<'_, Async> { |
| 162 | impl embedded_storage_async::nor_flash::ReadNorFlash for crate::_generated::flash_regions::$type_name<'_, Async> { | ||
| 163 | const READ_SIZE: usize = super::READ_SIZE; | 160 | const READ_SIZE: usize = super::READ_SIZE; |
| 164 | 161 | ||
| 165 | async fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error> { | 162 | async fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error> { |
| @@ -171,8 +168,7 @@ foreach_flash_region! { | |||
| 171 | } | 168 | } |
| 172 | } | 169 | } |
| 173 | 170 | ||
| 174 | #[cfg(feature = "nightly")] | 171 | impl embedded_storage_async::nor_flash::NorFlash for crate::_generated::flash_regions::$type_name<'_, Async> { |
| 175 | impl embedded_storage_async::nor_flash::NorFlash for crate::_generated::flash_regions::$type_name<'_, Async> { | ||
| 176 | const WRITE_SIZE: usize = $write_size; | 172 | const WRITE_SIZE: usize = $write_size; |
| 177 | const ERASE_SIZE: usize = $erase_size; | 173 | const ERASE_SIZE: usize = $erase_size; |
| 178 | 174 | ||
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs index 3e5959ddb..5d07020ce 100644 --- a/embassy-stm32/src/flash/f4.rs +++ b/embassy-stm32/src/flash/f4.rs | |||
| @@ -142,7 +142,6 @@ mod alt_regions { | |||
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | #[cfg(feature = "nightly")] | ||
| 146 | impl embedded_storage_async::nor_flash::ReadNorFlash for $type_name<'_, Async> { | 145 | impl embedded_storage_async::nor_flash::ReadNorFlash for $type_name<'_, Async> { |
| 147 | const READ_SIZE: usize = crate::flash::READ_SIZE; | 146 | const READ_SIZE: usize = crate::flash::READ_SIZE; |
| 148 | 147 | ||
| @@ -155,7 +154,6 @@ mod alt_regions { | |||
| 155 | } | 154 | } |
| 156 | } | 155 | } |
| 157 | 156 | ||
| 158 | #[cfg(feature = "nightly")] | ||
| 159 | impl embedded_storage_async::nor_flash::NorFlash for $type_name<'_, Async> { | 157 | impl embedded_storage_async::nor_flash::NorFlash for $type_name<'_, Async> { |
| 160 | const WRITE_SIZE: usize = $region.write_size as usize; | 158 | const WRITE_SIZE: usize = $region.write_size as usize; |
| 161 | const ERASE_SIZE: usize = $region.erase_size as usize; | 159 | const ERASE_SIZE: usize = $region.erase_size as usize; |
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index 011f4c07a..b863c4ffe 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -772,306 +772,293 @@ pub(crate) unsafe fn init(_cs: CriticalSection) { | |||
| 772 | }); | 772 | }); |
| 773 | } | 773 | } |
| 774 | 774 | ||
| 775 | mod eh02 { | 775 | impl<'d, T: Pin> embedded_hal_02::digital::v2::InputPin for Input<'d, T> { |
| 776 | use embedded_hal_02::digital::v2::{InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; | 776 | type Error = Infallible; |
| 777 | 777 | ||
| 778 | use super::*; | 778 | #[inline] |
| 779 | 779 | fn is_high(&self) -> Result<bool, Self::Error> { | |
| 780 | impl<'d, T: Pin> InputPin for Input<'d, T> { | 780 | Ok(self.is_high()) |
| 781 | type Error = Infallible; | ||
| 782 | |||
| 783 | #[inline] | ||
| 784 | fn is_high(&self) -> Result<bool, Self::Error> { | ||
| 785 | Ok(self.is_high()) | ||
| 786 | } | ||
| 787 | |||
| 788 | #[inline] | ||
| 789 | fn is_low(&self) -> Result<bool, Self::Error> { | ||
| 790 | Ok(self.is_low()) | ||
| 791 | } | ||
| 792 | } | 781 | } |
| 793 | 782 | ||
| 794 | impl<'d, T: Pin> OutputPin for Output<'d, T> { | 783 | #[inline] |
| 795 | type Error = Infallible; | 784 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 796 | 785 | Ok(self.is_low()) | |
| 797 | #[inline] | ||
| 798 | fn set_high(&mut self) -> Result<(), Self::Error> { | ||
| 799 | self.set_high(); | ||
| 800 | Ok(()) | ||
| 801 | } | ||
| 802 | |||
| 803 | #[inline] | ||
| 804 | fn set_low(&mut self) -> Result<(), Self::Error> { | ||
| 805 | self.set_low(); | ||
| 806 | Ok(()) | ||
| 807 | } | ||
| 808 | } | 786 | } |
| 787 | } | ||
| 809 | 788 | ||
| 810 | impl<'d, T: Pin> StatefulOutputPin for Output<'d, T> { | 789 | impl<'d, T: Pin> embedded_hal_02::digital::v2::OutputPin for Output<'d, T> { |
| 811 | #[inline] | 790 | type Error = Infallible; |
| 812 | fn is_set_high(&self) -> Result<bool, Self::Error> { | ||
| 813 | Ok(self.is_set_high()) | ||
| 814 | } | ||
| 815 | 791 | ||
| 816 | /// Is the output pin set as low? | 792 | #[inline] |
| 817 | #[inline] | 793 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 818 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 794 | self.set_high(); |
| 819 | Ok(self.is_set_low()) | 795 | Ok(()) |
| 820 | } | ||
| 821 | } | 796 | } |
| 822 | 797 | ||
| 823 | impl<'d, T: Pin> ToggleableOutputPin for Output<'d, T> { | 798 | #[inline] |
| 824 | type Error = Infallible; | 799 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 825 | #[inline] | 800 | self.set_low(); |
| 826 | fn toggle(&mut self) -> Result<(), Self::Error> { | 801 | Ok(()) |
| 827 | self.toggle(); | ||
| 828 | Ok(()) | ||
| 829 | } | ||
| 830 | } | 802 | } |
| 803 | } | ||
| 831 | 804 | ||
| 832 | impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> { | 805 | impl<'d, T: Pin> embedded_hal_02::digital::v2::StatefulOutputPin for Output<'d, T> { |
| 833 | type Error = Infallible; | 806 | #[inline] |
| 807 | fn is_set_high(&self) -> Result<bool, Self::Error> { | ||
| 808 | Ok(self.is_set_high()) | ||
| 809 | } | ||
| 834 | 810 | ||
| 835 | #[inline] | 811 | /// Is the output pin set as low? |
| 836 | fn set_high(&mut self) -> Result<(), Self::Error> { | 812 | #[inline] |
| 837 | self.set_high(); | 813 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 838 | Ok(()) | 814 | Ok(self.is_set_low()) |
| 839 | } | 815 | } |
| 816 | } | ||
| 840 | 817 | ||
| 841 | #[inline] | 818 | impl<'d, T: Pin> embedded_hal_02::digital::v2::ToggleableOutputPin for Output<'d, T> { |
| 842 | fn set_low(&mut self) -> Result<(), Self::Error> { | 819 | type Error = Infallible; |
| 843 | self.set_low(); | 820 | #[inline] |
| 844 | Ok(()) | 821 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 845 | } | 822 | self.toggle(); |
| 823 | Ok(()) | ||
| 846 | } | 824 | } |
| 825 | } | ||
| 847 | 826 | ||
| 848 | impl<'d, T: Pin> StatefulOutputPin for OutputOpenDrain<'d, T> { | 827 | impl<'d, T: Pin> embedded_hal_02::digital::v2::OutputPin for OutputOpenDrain<'d, T> { |
| 849 | #[inline] | 828 | type Error = Infallible; |
| 850 | fn is_set_high(&self) -> Result<bool, Self::Error> { | ||
| 851 | Ok(self.is_set_high()) | ||
| 852 | } | ||
| 853 | 829 | ||
| 854 | /// Is the output pin set as low? | 830 | #[inline] |
| 855 | #[inline] | 831 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 856 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 832 | self.set_high(); |
| 857 | Ok(self.is_set_low()) | 833 | Ok(()) |
| 858 | } | ||
| 859 | } | 834 | } |
| 860 | 835 | ||
| 861 | impl<'d, T: Pin> ToggleableOutputPin for OutputOpenDrain<'d, T> { | 836 | #[inline] |
| 862 | type Error = Infallible; | 837 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 863 | #[inline] | 838 | self.set_low(); |
| 864 | fn toggle(&mut self) -> Result<(), Self::Error> { | 839 | Ok(()) |
| 865 | self.toggle(); | ||
| 866 | Ok(()) | ||
| 867 | } | ||
| 868 | } | 840 | } |
| 841 | } | ||
| 869 | 842 | ||
| 870 | impl<'d, T: Pin> InputPin for Flex<'d, T> { | 843 | impl<'d, T: Pin> embedded_hal_02::digital::v2::StatefulOutputPin for OutputOpenDrain<'d, T> { |
| 871 | type Error = Infallible; | 844 | #[inline] |
| 845 | fn is_set_high(&self) -> Result<bool, Self::Error> { | ||
| 846 | Ok(self.is_set_high()) | ||
| 847 | } | ||
| 872 | 848 | ||
| 873 | #[inline] | 849 | /// Is the output pin set as low? |
| 874 | fn is_high(&self) -> Result<bool, Self::Error> { | 850 | #[inline] |
| 875 | Ok(self.is_high()) | 851 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 876 | } | 852 | Ok(self.is_set_low()) |
| 853 | } | ||
| 854 | } | ||
| 877 | 855 | ||
| 878 | #[inline] | 856 | impl<'d, T: Pin> embedded_hal_02::digital::v2::ToggleableOutputPin for OutputOpenDrain<'d, T> { |
| 879 | fn is_low(&self) -> Result<bool, Self::Error> { | 857 | type Error = Infallible; |
| 880 | Ok(self.is_low()) | 858 | #[inline] |
| 881 | } | 859 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 860 | self.toggle(); | ||
| 861 | Ok(()) | ||
| 882 | } | 862 | } |
| 863 | } | ||
| 883 | 864 | ||
| 884 | impl<'d, T: Pin> OutputPin for Flex<'d, T> { | 865 | impl<'d, T: Pin> embedded_hal_02::digital::v2::InputPin for Flex<'d, T> { |
| 885 | type Error = Infallible; | 866 | type Error = Infallible; |
| 886 | 867 | ||
| 887 | #[inline] | 868 | #[inline] |
| 888 | fn set_high(&mut self) -> Result<(), Self::Error> { | 869 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 889 | self.set_high(); | 870 | Ok(self.is_high()) |
| 890 | Ok(()) | 871 | } |
| 891 | } | ||
| 892 | 872 | ||
| 893 | #[inline] | 873 | #[inline] |
| 894 | fn set_low(&mut self) -> Result<(), Self::Error> { | 874 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 895 | self.set_low(); | 875 | Ok(self.is_low()) |
| 896 | Ok(()) | ||
| 897 | } | ||
| 898 | } | 876 | } |
| 877 | } | ||
| 899 | 878 | ||
| 900 | impl<'d, T: Pin> StatefulOutputPin for Flex<'d, T> { | 879 | impl<'d, T: Pin> embedded_hal_02::digital::v2::OutputPin for Flex<'d, T> { |
| 901 | #[inline] | 880 | type Error = Infallible; |
| 902 | fn is_set_high(&self) -> Result<bool, Self::Error> { | ||
| 903 | Ok(self.is_set_high()) | ||
| 904 | } | ||
| 905 | 881 | ||
| 906 | /// Is the output pin set as low? | 882 | #[inline] |
| 907 | #[inline] | 883 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 908 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 884 | self.set_high(); |
| 909 | Ok(self.is_set_low()) | 885 | Ok(()) |
| 910 | } | ||
| 911 | } | 886 | } |
| 912 | 887 | ||
| 913 | impl<'d, T: Pin> ToggleableOutputPin for Flex<'d, T> { | 888 | #[inline] |
| 914 | type Error = Infallible; | 889 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 915 | #[inline] | 890 | self.set_low(); |
| 916 | fn toggle(&mut self) -> Result<(), Self::Error> { | 891 | Ok(()) |
| 917 | self.toggle(); | ||
| 918 | Ok(()) | ||
| 919 | } | ||
| 920 | } | 892 | } |
| 921 | } | 893 | } |
| 922 | 894 | ||
| 923 | #[cfg(feature = "unstable-traits")] | 895 | impl<'d, T: Pin> embedded_hal_02::digital::v2::StatefulOutputPin for Flex<'d, T> { |
| 924 | mod eh1 { | 896 | #[inline] |
| 925 | use embedded_hal_1::digital::{ErrorType, InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; | 897 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 898 | Ok(self.is_set_high()) | ||
| 899 | } | ||
| 926 | 900 | ||
| 927 | use super::*; | 901 | /// Is the output pin set as low? |
| 902 | #[inline] | ||
| 903 | fn is_set_low(&self) -> Result<bool, Self::Error> { | ||
| 904 | Ok(self.is_set_low()) | ||
| 905 | } | ||
| 906 | } | ||
| 928 | 907 | ||
| 929 | impl<'d, T: Pin> ErrorType for Input<'d, T> { | 908 | impl<'d, T: Pin> embedded_hal_02::digital::v2::ToggleableOutputPin for Flex<'d, T> { |
| 930 | type Error = Infallible; | 909 | type Error = Infallible; |
| 910 | #[inline] | ||
| 911 | fn toggle(&mut self) -> Result<(), Self::Error> { | ||
| 912 | self.toggle(); | ||
| 913 | Ok(()) | ||
| 931 | } | 914 | } |
| 915 | } | ||
| 932 | 916 | ||
| 933 | impl<'d, T: Pin> InputPin for Input<'d, T> { | 917 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Input<'d, T> { |
| 934 | #[inline] | 918 | type Error = Infallible; |
| 935 | fn is_high(&self) -> Result<bool, Self::Error> { | 919 | } |
| 936 | Ok(self.is_high()) | ||
| 937 | } | ||
| 938 | 920 | ||
| 939 | #[inline] | 921 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Input<'d, T> { |
| 940 | fn is_low(&self) -> Result<bool, Self::Error> { | 922 | #[inline] |
| 941 | Ok(self.is_low()) | 923 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 942 | } | 924 | Ok(self.is_high()) |
| 943 | } | 925 | } |
| 944 | 926 | ||
| 945 | impl<'d, T: Pin> ErrorType for Output<'d, T> { | 927 | #[inline] |
| 946 | type Error = Infallible; | 928 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 929 | Ok(self.is_low()) | ||
| 947 | } | 930 | } |
| 931 | } | ||
| 948 | 932 | ||
| 949 | impl<'d, T: Pin> OutputPin for Output<'d, T> { | 933 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Output<'d, T> { |
| 950 | #[inline] | 934 | type Error = Infallible; |
| 951 | fn set_high(&mut self) -> Result<(), Self::Error> { | 935 | } |
| 952 | Ok(self.set_high()) | ||
| 953 | } | ||
| 954 | 936 | ||
| 955 | #[inline] | 937 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Output<'d, T> { |
| 956 | fn set_low(&mut self) -> Result<(), Self::Error> { | 938 | #[inline] |
| 957 | Ok(self.set_low()) | 939 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 958 | } | 940 | Ok(self.set_high()) |
| 959 | } | 941 | } |
| 960 | 942 | ||
| 961 | impl<'d, T: Pin> StatefulOutputPin for Output<'d, T> { | 943 | #[inline] |
| 962 | #[inline] | 944 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 963 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 945 | Ok(self.set_low()) |
| 964 | Ok(self.is_set_high()) | 946 | } |
| 965 | } | 947 | } |
| 966 | 948 | ||
| 967 | /// Is the output pin set as low? | 949 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Output<'d, T> { |
| 968 | #[inline] | 950 | #[inline] |
| 969 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 951 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 970 | Ok(self.is_set_low()) | 952 | Ok(self.is_set_high()) |
| 971 | } | ||
| 972 | } | 953 | } |
| 973 | 954 | ||
| 974 | impl<'d, T: Pin> ToggleableOutputPin for Output<'d, T> { | 955 | /// Is the output pin set as low? |
| 975 | #[inline] | 956 | #[inline] |
| 976 | fn toggle(&mut self) -> Result<(), Self::Error> { | 957 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 977 | Ok(self.toggle()) | 958 | Ok(self.is_set_low()) |
| 978 | } | ||
| 979 | } | 959 | } |
| 960 | } | ||
| 980 | 961 | ||
| 981 | impl<'d, T: Pin> ErrorType for OutputOpenDrain<'d, T> { | 962 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Output<'d, T> { |
| 982 | type Error = Infallible; | 963 | #[inline] |
| 964 | fn toggle(&mut self) -> Result<(), Self::Error> { | ||
| 965 | Ok(self.toggle()) | ||
| 983 | } | 966 | } |
| 967 | } | ||
| 984 | 968 | ||
| 985 | impl<'d, T: Pin> InputPin for OutputOpenDrain<'d, T> { | 969 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for OutputOpenDrain<'d, T> { |
| 986 | #[inline] | 970 | type Error = Infallible; |
| 987 | fn is_high(&self) -> Result<bool, Self::Error> { | 971 | } |
| 988 | Ok(self.is_high()) | ||
| 989 | } | ||
| 990 | 972 | ||
| 991 | #[inline] | 973 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for OutputOpenDrain<'d, T> { |
| 992 | fn is_low(&self) -> Result<bool, Self::Error> { | 974 | #[inline] |
| 993 | Ok(self.is_low()) | 975 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 994 | } | 976 | Ok(self.is_high()) |
| 995 | } | 977 | } |
| 996 | 978 | ||
| 997 | impl<'d, T: Pin> OutputPin for OutputOpenDrain<'d, T> { | 979 | #[inline] |
| 998 | #[inline] | 980 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 999 | fn set_high(&mut self) -> Result<(), Self::Error> { | 981 | Ok(self.is_low()) |
| 1000 | Ok(self.set_high()) | 982 | } |
| 1001 | } | 983 | } |
| 1002 | 984 | ||
| 1003 | #[inline] | 985 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for OutputOpenDrain<'d, T> { |
| 1004 | fn set_low(&mut self) -> Result<(), Self::Error> { | 986 | #[inline] |
| 1005 | Ok(self.set_low()) | 987 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 1006 | } | 988 | Ok(self.set_high()) |
| 1007 | } | 989 | } |
| 1008 | 990 | ||
| 1009 | impl<'d, T: Pin> StatefulOutputPin for OutputOpenDrain<'d, T> { | 991 | #[inline] |
| 1010 | #[inline] | 992 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 1011 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 993 | Ok(self.set_low()) |
| 1012 | Ok(self.is_set_high()) | 994 | } |
| 1013 | } | 995 | } |
| 1014 | 996 | ||
| 1015 | /// Is the output pin set as low? | 997 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for OutputOpenDrain<'d, T> { |
| 1016 | #[inline] | 998 | #[inline] |
| 1017 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 999 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 1018 | Ok(self.is_set_low()) | 1000 | Ok(self.is_set_high()) |
| 1019 | } | ||
| 1020 | } | 1001 | } |
| 1021 | 1002 | ||
| 1022 | impl<'d, T: Pin> ToggleableOutputPin for OutputOpenDrain<'d, T> { | 1003 | /// Is the output pin set as low? |
| 1023 | #[inline] | 1004 | #[inline] |
| 1024 | fn toggle(&mut self) -> Result<(), Self::Error> { | 1005 | fn is_set_low(&self) -> Result<bool, Self::Error> { |
| 1025 | Ok(self.toggle()) | 1006 | Ok(self.is_set_low()) |
| 1026 | } | ||
| 1027 | } | 1007 | } |
| 1008 | } | ||
| 1028 | 1009 | ||
| 1029 | impl<'d, T: Pin> InputPin for Flex<'d, T> { | 1010 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for OutputOpenDrain<'d, T> { |
| 1030 | #[inline] | 1011 | #[inline] |
| 1031 | fn is_high(&self) -> Result<bool, Self::Error> { | 1012 | fn toggle(&mut self) -> Result<(), Self::Error> { |
| 1032 | Ok(self.is_high()) | 1013 | Ok(self.toggle()) |
| 1033 | } | 1014 | } |
| 1015 | } | ||
| 1034 | 1016 | ||
| 1035 | #[inline] | 1017 | impl<'d, T: Pin> embedded_hal_1::digital::InputPin for Flex<'d, T> { |
| 1036 | fn is_low(&self) -> Result<bool, Self::Error> { | 1018 | #[inline] |
| 1037 | Ok(self.is_low()) | 1019 | fn is_high(&self) -> Result<bool, Self::Error> { |
| 1038 | } | 1020 | Ok(self.is_high()) |
| 1039 | } | 1021 | } |
| 1040 | 1022 | ||
| 1041 | impl<'d, T: Pin> OutputPin for Flex<'d, T> { | 1023 | #[inline] |
| 1042 | #[inline] | 1024 | fn is_low(&self) -> Result<bool, Self::Error> { |
| 1043 | fn set_high(&mut self) -> Result<(), Self::Error> { | 1025 | Ok(self.is_low()) |
| 1044 | Ok(self.set_high()) | 1026 | } |
| 1045 | } | 1027 | } |
| 1046 | 1028 | ||
| 1047 | #[inline] | 1029 | impl<'d, T: Pin> embedded_hal_1::digital::OutputPin for Flex<'d, T> { |
| 1048 | fn set_low(&mut self) -> Result<(), Self::Error> { | 1030 | #[inline] |
| 1049 | Ok(self.set_low()) | 1031 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 1050 | } | 1032 | Ok(self.set_high()) |
| 1051 | } | 1033 | } |
| 1052 | 1034 | ||
| 1053 | impl<'d, T: Pin> ToggleableOutputPin for Flex<'d, T> { | 1035 | #[inline] |
| 1054 | #[inline] | 1036 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 1055 | fn toggle(&mut self) -> Result<(), Self::Error> { | 1037 | Ok(self.set_low()) |
| 1056 | Ok(self.toggle()) | ||
| 1057 | } | ||
| 1058 | } | 1038 | } |
| 1039 | } | ||
| 1059 | 1040 | ||
| 1060 | impl<'d, T: Pin> ErrorType for Flex<'d, T> { | 1041 | impl<'d, T: Pin> embedded_hal_1::digital::ToggleableOutputPin for Flex<'d, T> { |
| 1061 | type Error = Infallible; | 1042 | #[inline] |
| 1043 | fn toggle(&mut self) -> Result<(), Self::Error> { | ||
| 1044 | Ok(self.toggle()) | ||
| 1062 | } | 1045 | } |
| 1046 | } | ||
| 1063 | 1047 | ||
| 1064 | impl<'d, T: Pin> StatefulOutputPin for Flex<'d, T> { | 1048 | impl<'d, T: Pin> embedded_hal_1::digital::ErrorType for Flex<'d, T> { |
| 1065 | #[inline] | 1049 | type Error = Infallible; |
| 1066 | fn is_set_high(&self) -> Result<bool, Self::Error> { | 1050 | } |
| 1067 | Ok(self.is_set_high()) | ||
| 1068 | } | ||
| 1069 | 1051 | ||
| 1070 | /// Is the output pin set as low? | 1052 | impl<'d, T: Pin> embedded_hal_1::digital::StatefulOutputPin for Flex<'d, T> { |
| 1071 | #[inline] | 1053 | #[inline] |
| 1072 | fn is_set_low(&self) -> Result<bool, Self::Error> { | 1054 | fn is_set_high(&self) -> Result<bool, Self::Error> { |
| 1073 | Ok(self.is_set_low()) | 1055 | Ok(self.is_set_high()) |
| 1074 | } | 1056 | } |
| 1057 | |||
| 1058 | /// Is the output pin set as low? | ||
| 1059 | #[inline] | ||
| 1060 | fn is_set_low(&self) -> Result<bool, Self::Error> { | ||
| 1061 | Ok(self.is_set_low()) | ||
| 1075 | } | 1062 | } |
| 1076 | } | 1063 | } |
| 1077 | 1064 | ||
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 19346d707..d2a50cf7e 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | 4 | ||
| 5 | use crate::dma::NoDma; | ||
| 5 | use crate::interrupt; | 6 | use crate::interrupt; |
| 6 | 7 | ||
| 7 | #[cfg_attr(i2c_v1, path = "v1.rs")] | 8 | #[cfg_attr(i2c_v1, path = "v1.rs")] |
| @@ -97,107 +98,92 @@ foreach_peripheral!( | |||
| 97 | }; | 98 | }; |
| 98 | ); | 99 | ); |
| 99 | 100 | ||
| 100 | mod eh02 { | 101 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::Read for I2c<'d, T> { |
| 101 | use super::*; | 102 | type Error = Error; |
| 102 | |||
| 103 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::Read for I2c<'d, T> { | ||
| 104 | type Error = Error; | ||
| 105 | 103 | ||
| 106 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { | 104 | fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> { |
| 107 | self.blocking_read(address, buffer) | 105 | self.blocking_read(address, buffer) |
| 108 | } | ||
| 109 | } | 106 | } |
| 107 | } | ||
| 110 | 108 | ||
| 111 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::Write for I2c<'d, T> { | 109 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::Write for I2c<'d, T> { |
| 112 | type Error = Error; | 110 | type Error = Error; |
| 113 | 111 | ||
| 114 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { | 112 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { |
| 115 | self.blocking_write(address, write) | 113 | self.blocking_write(address, write) |
| 116 | } | ||
| 117 | } | 114 | } |
| 115 | } | ||
| 118 | 116 | ||
| 119 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::WriteRead for I2c<'d, T> { | 117 | impl<'d, T: Instance> embedded_hal_02::blocking::i2c::WriteRead for I2c<'d, T> { |
| 120 | type Error = Error; | 118 | type Error = Error; |
| 121 | 119 | ||
| 122 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 120 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 123 | self.blocking_write_read(address, write, read) | 121 | self.blocking_write_read(address, write, read) |
| 124 | } | ||
| 125 | } | 122 | } |
| 126 | } | 123 | } |
| 127 | 124 | ||
| 128 | #[cfg(feature = "unstable-traits")] | 125 | impl embedded_hal_1::i2c::Error for Error { |
| 129 | mod eh1 { | 126 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { |
| 130 | use super::*; | 127 | match *self { |
| 131 | use crate::dma::NoDma; | 128 | Self::Bus => embedded_hal_1::i2c::ErrorKind::Bus, |
| 132 | 129 | Self::Arbitration => embedded_hal_1::i2c::ErrorKind::ArbitrationLoss, | |
| 133 | impl embedded_hal_1::i2c::Error for Error { | 130 | Self::Nack => { |
| 134 | fn kind(&self) -> embedded_hal_1::i2c::ErrorKind { | 131 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Unknown) |
| 135 | match *self { | ||
| 136 | Self::Bus => embedded_hal_1::i2c::ErrorKind::Bus, | ||
| 137 | Self::Arbitration => embedded_hal_1::i2c::ErrorKind::ArbitrationLoss, | ||
| 138 | Self::Nack => { | ||
| 139 | embedded_hal_1::i2c::ErrorKind::NoAcknowledge(embedded_hal_1::i2c::NoAcknowledgeSource::Unknown) | ||
| 140 | } | ||
| 141 | Self::Timeout => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 142 | Self::Crc => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 143 | Self::Overrun => embedded_hal_1::i2c::ErrorKind::Overrun, | ||
| 144 | Self::ZeroLengthTransfer => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 145 | } | 132 | } |
| 133 | Self::Timeout => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 134 | Self::Crc => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 135 | Self::Overrun => embedded_hal_1::i2c::ErrorKind::Overrun, | ||
| 136 | Self::ZeroLengthTransfer => embedded_hal_1::i2c::ErrorKind::Other, | ||
| 146 | } | 137 | } |
| 147 | } | 138 | } |
| 139 | } | ||
| 148 | 140 | ||
| 149 | impl<'d, T: Instance, TXDMA, RXDMA> embedded_hal_1::i2c::ErrorType for I2c<'d, T, TXDMA, RXDMA> { | 141 | impl<'d, T: Instance, TXDMA, RXDMA> embedded_hal_1::i2c::ErrorType for I2c<'d, T, TXDMA, RXDMA> { |
| 150 | type Error = Error; | 142 | type Error = Error; |
| 151 | } | 143 | } |
| 152 | 144 | ||
| 153 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for I2c<'d, T, NoDma, NoDma> { | 145 | impl<'d, T: Instance> embedded_hal_1::i2c::I2c for I2c<'d, T, NoDma, NoDma> { |
| 154 | fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { | 146 | fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { |
| 155 | self.blocking_read(address, read) | 147 | self.blocking_read(address, read) |
| 156 | } | 148 | } |
| 157 | 149 | ||
| 158 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { | 150 | fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { |
| 159 | self.blocking_write(address, write) | 151 | self.blocking_write(address, write) |
| 160 | } | 152 | } |
| 161 | 153 | ||
| 162 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 154 | fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 163 | self.blocking_write_read(address, write, read) | 155 | self.blocking_write_read(address, write, read) |
| 164 | } | 156 | } |
| 165 | 157 | ||
| 166 | fn transaction( | 158 | fn transaction( |
| 167 | &mut self, | 159 | &mut self, |
| 168 | _address: u8, | 160 | _address: u8, |
| 169 | _operations: &mut [embedded_hal_1::i2c::Operation<'_>], | 161 | _operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 170 | ) -> Result<(), Self::Error> { | 162 | ) -> Result<(), Self::Error> { |
| 171 | todo!(); | 163 | todo!(); |
| 172 | } | ||
| 173 | } | 164 | } |
| 174 | } | 165 | } |
| 175 | 166 | ||
| 176 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 167 | impl<'d, T: Instance, TXDMA: TxDma<T>, RXDMA: RxDma<T>> embedded_hal_async::i2c::I2c for I2c<'d, T, TXDMA, RXDMA> { |
| 177 | mod eha { | 168 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { |
| 178 | use super::*; | 169 | self.read(address, read).await |
| 179 | 170 | } | |
| 180 | impl<'d, T: Instance, TXDMA: TxDma<T>, RXDMA: RxDma<T>> embedded_hal_async::i2c::I2c for I2c<'d, T, TXDMA, RXDMA> { | ||
| 181 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { | ||
| 182 | self.read(address, read).await | ||
| 183 | } | ||
| 184 | 171 | ||
| 185 | async fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { | 172 | async fn write(&mut self, address: u8, write: &[u8]) -> Result<(), Self::Error> { |
| 186 | self.write(address, write).await | 173 | self.write(address, write).await |
| 187 | } | 174 | } |
| 188 | 175 | ||
| 189 | async fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { | 176 | async fn write_read(&mut self, address: u8, write: &[u8], read: &mut [u8]) -> Result<(), Self::Error> { |
| 190 | self.write_read(address, write, read).await | 177 | self.write_read(address, write, read).await |
| 191 | } | 178 | } |
| 192 | 179 | ||
| 193 | async fn transaction( | 180 | async fn transaction( |
| 194 | &mut self, | 181 | &mut self, |
| 195 | address: u8, | 182 | address: u8, |
| 196 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], | 183 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 197 | ) -> Result<(), Self::Error> { | 184 | ) -> Result<(), Self::Error> { |
| 198 | let _ = address; | 185 | let _ = address; |
| 199 | let _ = operations; | 186 | let _ = operations; |
| 200 | todo!() | 187 | todo!() |
| 201 | } | ||
| 202 | } | 188 | } |
| 203 | } | 189 | } |
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 511da9179..7ce801a0a 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![cfg_attr(not(test), no_std)] | 1 | #![cfg_attr(not(test), no_std)] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | ||
| 4 | 3 | ||
| 5 | //! ## Feature flags | 4 | //! ## Feature flags |
| 6 | #![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)] | 5 | #![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)] |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index c391e0a5a..92599c75e 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -848,102 +848,88 @@ fn transfer_word<W: Word>(regs: Regs, tx_word: W) -> Result<W, Error> { | |||
| 848 | Ok(rx_word) | 848 | Ok(rx_word) |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | mod eh02 { | 851 | // Note: It is not possible to impl these traits generically in embedded-hal 0.2 due to a conflict with |
| 852 | use super::*; | 852 | // some marker traits. For details, see https://github.com/rust-embedded/embedded-hal/pull/289 |
| 853 | 853 | macro_rules! impl_blocking { | |
| 854 | // Note: It is not possible to impl these traits generically in embedded-hal 0.2 due to a conflict with | 854 | ($w:ident) => { |
| 855 | // some marker traits. For details, see https://github.com/rust-embedded/embedded-hal/pull/289 | 855 | impl<'d, T: Instance, Tx, Rx> embedded_hal_02::blocking::spi::Write<$w> for Spi<'d, T, Tx, Rx> { |
| 856 | macro_rules! impl_blocking { | 856 | type Error = Error; |
| 857 | ($w:ident) => { | 857 | |
| 858 | impl<'d, T: Instance, Tx, Rx> embedded_hal_02::blocking::spi::Write<$w> for Spi<'d, T, Tx, Rx> { | 858 | fn write(&mut self, words: &[$w]) -> Result<(), Self::Error> { |
| 859 | type Error = Error; | 859 | self.blocking_write(words) |
| 860 | |||
| 861 | fn write(&mut self, words: &[$w]) -> Result<(), Self::Error> { | ||
| 862 | self.blocking_write(words) | ||
| 863 | } | ||
| 864 | } | 860 | } |
| 861 | } | ||
| 865 | 862 | ||
| 866 | impl<'d, T: Instance, Tx, Rx> embedded_hal_02::blocking::spi::Transfer<$w> for Spi<'d, T, Tx, Rx> { | 863 | impl<'d, T: Instance, Tx, Rx> embedded_hal_02::blocking::spi::Transfer<$w> for Spi<'d, T, Tx, Rx> { |
| 867 | type Error = Error; | 864 | type Error = Error; |
| 868 | 865 | ||
| 869 | fn transfer<'w>(&mut self, words: &'w mut [$w]) -> Result<&'w [$w], Self::Error> { | 866 | fn transfer<'w>(&mut self, words: &'w mut [$w]) -> Result<&'w [$w], Self::Error> { |
| 870 | self.blocking_transfer_in_place(words)?; | 867 | self.blocking_transfer_in_place(words)?; |
| 871 | Ok(words) | 868 | Ok(words) |
| 872 | } | ||
| 873 | } | 869 | } |
| 874 | }; | 870 | } |
| 875 | } | 871 | }; |
| 876 | |||
| 877 | impl_blocking!(u8); | ||
| 878 | impl_blocking!(u16); | ||
| 879 | } | 872 | } |
| 880 | 873 | ||
| 881 | #[cfg(feature = "unstable-traits")] | 874 | impl_blocking!(u8); |
| 882 | mod eh1 { | 875 | impl_blocking!(u16); |
| 883 | use super::*; | ||
| 884 | 876 | ||
| 885 | impl<'d, T: Instance, Tx, Rx> embedded_hal_1::spi::ErrorType for Spi<'d, T, Tx, Rx> { | 877 | impl<'d, T: Instance, Tx, Rx> embedded_hal_1::spi::ErrorType for Spi<'d, T, Tx, Rx> { |
| 886 | type Error = Error; | 878 | type Error = Error; |
| 887 | } | 879 | } |
| 888 | 880 | ||
| 889 | impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> { | 881 | impl<'d, T: Instance, W: Word, Tx, Rx> embedded_hal_1::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> { |
| 890 | fn flush(&mut self) -> Result<(), Self::Error> { | 882 | fn flush(&mut self) -> Result<(), Self::Error> { |
| 891 | Ok(()) | 883 | Ok(()) |
| 892 | } | 884 | } |
| 893 | 885 | ||
| 894 | fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { | 886 | fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { |
| 895 | self.blocking_read(words) | 887 | self.blocking_read(words) |
| 896 | } | 888 | } |
| 897 | 889 | ||
| 898 | fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { | 890 | fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { |
| 899 | self.blocking_write(words) | 891 | self.blocking_write(words) |
| 900 | } | 892 | } |
| 901 | 893 | ||
| 902 | fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { | 894 | fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { |
| 903 | self.blocking_transfer(read, write) | 895 | self.blocking_transfer(read, write) |
| 904 | } | 896 | } |
| 905 | 897 | ||
| 906 | fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Self::Error> { | 898 | fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Self::Error> { |
| 907 | self.blocking_transfer_in_place(words) | 899 | self.blocking_transfer_in_place(words) |
| 908 | } | ||
| 909 | } | 900 | } |
| 901 | } | ||
| 910 | 902 | ||
| 911 | impl embedded_hal_1::spi::Error for Error { | 903 | impl embedded_hal_1::spi::Error for Error { |
| 912 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { | 904 | fn kind(&self) -> embedded_hal_1::spi::ErrorKind { |
| 913 | match *self { | 905 | match *self { |
| 914 | Self::Framing => embedded_hal_1::spi::ErrorKind::FrameFormat, | 906 | Self::Framing => embedded_hal_1::spi::ErrorKind::FrameFormat, |
| 915 | Self::Crc => embedded_hal_1::spi::ErrorKind::Other, | 907 | Self::Crc => embedded_hal_1::spi::ErrorKind::Other, |
| 916 | Self::ModeFault => embedded_hal_1::spi::ErrorKind::ModeFault, | 908 | Self::ModeFault => embedded_hal_1::spi::ErrorKind::ModeFault, |
| 917 | Self::Overrun => embedded_hal_1::spi::ErrorKind::Overrun, | 909 | Self::Overrun => embedded_hal_1::spi::ErrorKind::Overrun, |
| 918 | } | ||
| 919 | } | 910 | } |
| 920 | } | 911 | } |
| 921 | } | 912 | } |
| 922 | 913 | ||
| 923 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 914 | impl<'d, T: Instance, Tx: TxDma<T>, Rx: RxDma<T>, W: Word> embedded_hal_async::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> { |
| 924 | mod eha { | 915 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 925 | use super::*; | 916 | Ok(()) |
| 926 | 917 | } | |
| 927 | impl<'d, T: Instance, Tx: TxDma<T>, Rx: RxDma<T>, W: Word> embedded_hal_async::spi::SpiBus<W> for Spi<'d, T, Tx, Rx> { | ||
| 928 | async fn flush(&mut self) -> Result<(), Self::Error> { | ||
| 929 | Ok(()) | ||
| 930 | } | ||
| 931 | 918 | ||
| 932 | async fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { | 919 | async fn write(&mut self, words: &[W]) -> Result<(), Self::Error> { |
| 933 | self.write(words).await | 920 | self.write(words).await |
| 934 | } | 921 | } |
| 935 | 922 | ||
| 936 | async fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { | 923 | async fn read(&mut self, words: &mut [W]) -> Result<(), Self::Error> { |
| 937 | self.read(words).await | 924 | self.read(words).await |
| 938 | } | 925 | } |
| 939 | 926 | ||
| 940 | async fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { | 927 | async fn transfer(&mut self, read: &mut [W], write: &[W]) -> Result<(), Self::Error> { |
| 941 | self.transfer(read, write).await | 928 | self.transfer(read, write).await |
| 942 | } | 929 | } |
| 943 | 930 | ||
| 944 | async fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Self::Error> { | 931 | async fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Self::Error> { |
| 945 | self.transfer_in_place(words).await | 932 | self.transfer_in_place(words).await |
| 946 | } | ||
| 947 | } | 933 | } |
| 948 | } | 934 | } |
| 949 | 935 | ||
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index 4daddfe91..a2e4ceaae 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -560,172 +560,120 @@ impl<'d, T: BasicInstance> embedded_io::Write for BufferedUartTx<'d, T> { | |||
| 560 | } | 560 | } |
| 561 | } | 561 | } |
| 562 | 562 | ||
| 563 | mod eh02 { | 563 | impl<'d, T: BasicInstance> embedded_hal_02::serial::Read<u8> for BufferedUartRx<'d, T> { |
| 564 | use super::*; | 564 | type Error = Error; |
| 565 | 565 | ||
| 566 | impl<'d, T: BasicInstance> embedded_hal_02::serial::Read<u8> for BufferedUartRx<'d, T> { | 566 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 567 | type Error = Error; | 567 | let r = T::regs(); |
| 568 | 568 | unsafe { | |
| 569 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 569 | let sr = sr(r).read(); |
| 570 | let r = T::regs(); | 570 | if sr.pe() { |
| 571 | unsafe { | 571 | rdr(r).read_volatile(); |
| 572 | let sr = sr(r).read(); | 572 | Err(nb::Error::Other(Error::Parity)) |
| 573 | if sr.pe() { | 573 | } else if sr.fe() { |
| 574 | rdr(r).read_volatile(); | 574 | rdr(r).read_volatile(); |
| 575 | Err(nb::Error::Other(Error::Parity)) | 575 | Err(nb::Error::Other(Error::Framing)) |
| 576 | } else if sr.fe() { | 576 | } else if sr.ne() { |
| 577 | rdr(r).read_volatile(); | 577 | rdr(r).read_volatile(); |
| 578 | Err(nb::Error::Other(Error::Framing)) | 578 | Err(nb::Error::Other(Error::Noise)) |
| 579 | } else if sr.ne() { | 579 | } else if sr.ore() { |
| 580 | rdr(r).read_volatile(); | 580 | rdr(r).read_volatile(); |
| 581 | Err(nb::Error::Other(Error::Noise)) | 581 | Err(nb::Error::Other(Error::Overrun)) |
| 582 | } else if sr.ore() { | 582 | } else if sr.rxne() { |
| 583 | rdr(r).read_volatile(); | 583 | Ok(rdr(r).read_volatile()) |
| 584 | Err(nb::Error::Other(Error::Overrun)) | 584 | } else { |
| 585 | } else if sr.rxne() { | 585 | Err(nb::Error::WouldBlock) |
| 586 | Ok(rdr(r).read_volatile()) | ||
| 587 | } else { | ||
| 588 | Err(nb::Error::WouldBlock) | ||
| 589 | } | ||
| 590 | } | 586 | } |
| 591 | } | 587 | } |
| 592 | } | 588 | } |
| 589 | } | ||
| 593 | 590 | ||
| 594 | impl<'d, T: BasicInstance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUartTx<'d, T> { | 591 | impl<'d, T: BasicInstance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUartTx<'d, T> { |
| 595 | type Error = Error; | 592 | type Error = Error; |
| 596 | 593 | ||
| 597 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { | 594 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { |
| 598 | while !buffer.is_empty() { | 595 | while !buffer.is_empty() { |
| 599 | match self.blocking_write(buffer) { | 596 | match self.blocking_write(buffer) { |
| 600 | Ok(0) => panic!("zero-length write."), | 597 | Ok(0) => panic!("zero-length write."), |
| 601 | Ok(n) => buffer = &buffer[n..], | 598 | Ok(n) => buffer = &buffer[n..], |
| 602 | Err(e) => return Err(e), | 599 | Err(e) => return Err(e), |
| 603 | } | ||
| 604 | } | 600 | } |
| 605 | Ok(()) | ||
| 606 | } | ||
| 607 | |||
| 608 | fn bflush(&mut self) -> Result<(), Self::Error> { | ||
| 609 | self.blocking_flush() | ||
| 610 | } | 601 | } |
| 602 | Ok(()) | ||
| 611 | } | 603 | } |
| 612 | 604 | ||
| 613 | impl<'d, T: BasicInstance> embedded_hal_02::serial::Read<u8> for BufferedUart<'d, T> { | 605 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 614 | type Error = Error; | 606 | self.blocking_flush() |
| 615 | |||
| 616 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | ||
| 617 | embedded_hal_02::serial::Read::read(&mut self.rx) | ||
| 618 | } | ||
| 619 | } | 607 | } |
| 608 | } | ||
| 620 | 609 | ||
| 621 | impl<'d, T: BasicInstance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUart<'d, T> { | 610 | impl<'d, T: BasicInstance> embedded_hal_02::serial::Read<u8> for BufferedUart<'d, T> { |
| 622 | type Error = Error; | 611 | type Error = Error; |
| 623 | |||
| 624 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { | ||
| 625 | while !buffer.is_empty() { | ||
| 626 | match self.tx.blocking_write(buffer) { | ||
| 627 | Ok(0) => panic!("zero-length write."), | ||
| 628 | Ok(n) => buffer = &buffer[n..], | ||
| 629 | Err(e) => return Err(e), | ||
| 630 | } | ||
| 631 | } | ||
| 632 | Ok(()) | ||
| 633 | } | ||
| 634 | 612 | ||
| 635 | fn bflush(&mut self) -> Result<(), Self::Error> { | 613 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 636 | self.tx.blocking_flush() | 614 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 637 | } | ||
| 638 | } | 615 | } |
| 639 | } | 616 | } |
| 640 | 617 | ||
| 641 | #[cfg(feature = "unstable-traits")] | 618 | impl<'d, T: BasicInstance> embedded_hal_02::blocking::serial::Write<u8> for BufferedUart<'d, T> { |
| 642 | mod eh1 { | 619 | type Error = Error; |
| 643 | use super::*; | ||
| 644 | 620 | ||
| 645 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUart<'d, T> { | 621 | fn bwrite_all(&mut self, mut buffer: &[u8]) -> Result<(), Self::Error> { |
| 646 | type Error = Error; | 622 | while !buffer.is_empty() { |
| 623 | match self.tx.blocking_write(buffer) { | ||
| 624 | Ok(0) => panic!("zero-length write."), | ||
| 625 | Ok(n) => buffer = &buffer[n..], | ||
| 626 | Err(e) => return Err(e), | ||
| 627 | } | ||
| 628 | } | ||
| 629 | Ok(()) | ||
| 647 | } | 630 | } |
| 648 | 631 | ||
| 649 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUartTx<'d, T> { | 632 | fn bflush(&mut self) -> Result<(), Self::Error> { |
| 650 | type Error = Error; | 633 | self.tx.blocking_flush() |
| 651 | } | 634 | } |
| 635 | } | ||
| 652 | 636 | ||
| 653 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUartRx<'d, T> { | 637 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUart<'d, T> { |
| 654 | type Error = Error; | 638 | type Error = Error; |
| 655 | } | 639 | } |
| 656 | 640 | ||
| 657 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Read for BufferedUartRx<'d, T> { | 641 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUartTx<'d, T> { |
| 658 | fn read(&mut self) -> nb::Result<u8, Self::Error> { | 642 | type Error = Error; |
| 659 | embedded_hal_02::serial::Read::read(self) | 643 | } |
| 660 | } | ||
| 661 | } | ||
| 662 | 644 | ||
| 663 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Write for BufferedUartTx<'d, T> { | 645 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::ErrorType for BufferedUartRx<'d, T> { |
| 664 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 646 | type Error = Error; |
| 665 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) | 647 | } |
| 666 | } | ||
| 667 | 648 | ||
| 668 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | 649 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Read for BufferedUartRx<'d, T> { |
| 669 | self.blocking_flush().map_err(nb::Error::Other) | 650 | fn read(&mut self) -> nb::Result<u8, Self::Error> { |
| 670 | } | 651 | embedded_hal_02::serial::Read::read(self) |
| 671 | } | 652 | } |
| 653 | } | ||
| 672 | 654 | ||
| 673 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Read for BufferedUart<'d, T> { | 655 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Write for BufferedUartTx<'d, T> { |
| 674 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 656 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 675 | embedded_hal_02::serial::Read::read(&mut self.rx) | 657 | self.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) |
| 676 | } | ||
| 677 | } | 658 | } |
| 678 | 659 | ||
| 679 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Write for BufferedUart<'d, T> { | 660 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 680 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 661 | self.blocking_flush().map_err(nb::Error::Other) |
| 681 | self.tx.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) | ||
| 682 | } | ||
| 683 | |||
| 684 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | ||
| 685 | self.tx.blocking_flush().map_err(nb::Error::Other) | ||
| 686 | } | ||
| 687 | } | 662 | } |
| 688 | } | 663 | } |
| 689 | 664 | ||
| 690 | #[cfg(all( | 665 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Read for BufferedUart<'d, T> { |
| 691 | feature = "unstable-traits", | 666 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 692 | feature = "nightly", | 667 | embedded_hal_02::serial::Read::read(&mut self.rx) |
| 693 | feature = "_todo_embedded_hal_serial" | ||
| 694 | ))] | ||
| 695 | mod eha { | ||
| 696 | use core::future::Future; | ||
| 697 | |||
| 698 | use super::*; | ||
| 699 | |||
| 700 | impl<'d, T: BasicInstance> embedded_hal_async::serial::Write for BufferedUartTx<'d, T> { | ||
| 701 | async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error> { | ||
| 702 | Self::write(buf) | ||
| 703 | } | ||
| 704 | |||
| 705 | async fn flush(&mut self) -> Result<(), Self::Error> { | ||
| 706 | Self::flush() | ||
| 707 | } | ||
| 708 | } | ||
| 709 | |||
| 710 | impl<'d, T: BasicInstance> embedded_hal_async::serial::Read for BufferedUartRx<'d, T> { | ||
| 711 | async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error> { | ||
| 712 | Self::read(buf) | ||
| 713 | } | ||
| 714 | } | 668 | } |
| 669 | } | ||
| 715 | 670 | ||
| 716 | impl<'d, T: BasicInstance> embedded_hal_async::serial::Write for BufferedUart<'d, T> { | 671 | impl<'d, T: BasicInstance> embedded_hal_nb::serial::Write for BufferedUart<'d, T> { |
| 717 | async fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error> { | 672 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 718 | self.tx.write(buf) | 673 | self.tx.blocking_write(&[char]).map(drop).map_err(nb::Error::Other) |
| 719 | } | ||
| 720 | |||
| 721 | async fn flush(&mut self) -> Result<(), Self::Error> { | ||
| 722 | self.tx.flush() | ||
| 723 | } | ||
| 724 | } | 674 | } |
| 725 | 675 | ||
| 726 | impl<'d, T: BasicInstance> embedded_hal_async::serial::Read for BufferedUart<'d, T> { | 676 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 727 | async fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error> { | 677 | self.tx.blocking_flush().map_err(nb::Error::Other) |
| 728 | self.rx.read(buf) | ||
| 729 | } | ||
| 730 | } | 678 | } |
| 731 | } | 679 | } |
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index ea127e7f7..d5828a492 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -1010,102 +1010,93 @@ fn configure( | |||
| 1010 | Ok(()) | 1010 | Ok(()) |
| 1011 | } | 1011 | } |
| 1012 | 1012 | ||
| 1013 | mod eh02 { | 1013 | impl<'d, T: BasicInstance, RxDma> embedded_hal_02::serial::Read<u8> for UartRx<'d, T, RxDma> { |
| 1014 | use super::*; | 1014 | type Error = Error; |
| 1015 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | ||
| 1016 | self.nb_read() | ||
| 1017 | } | ||
| 1018 | } | ||
| 1015 | 1019 | ||
| 1016 | impl<'d, T: BasicInstance, RxDma> embedded_hal_02::serial::Read<u8> for UartRx<'d, T, RxDma> { | 1020 | impl<'d, T: BasicInstance, TxDma> embedded_hal_02::blocking::serial::Write<u8> for UartTx<'d, T, TxDma> { |
| 1017 | type Error = Error; | 1021 | type Error = Error; |
| 1018 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 1022 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 1019 | self.nb_read() | 1023 | self.blocking_write(buffer) |
| 1020 | } | 1024 | } |
| 1025 | fn bflush(&mut self) -> Result<(), Self::Error> { | ||
| 1026 | self.blocking_flush() | ||
| 1021 | } | 1027 | } |
| 1028 | } | ||
| 1022 | 1029 | ||
| 1023 | impl<'d, T: BasicInstance, TxDma> embedded_hal_02::blocking::serial::Write<u8> for UartTx<'d, T, TxDma> { | 1030 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_02::serial::Read<u8> for Uart<'d, T, TxDma, RxDma> { |
| 1024 | type Error = Error; | 1031 | type Error = Error; |
| 1025 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 1032 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 1026 | self.blocking_write(buffer) | 1033 | self.nb_read() |
| 1027 | } | ||
| 1028 | fn bflush(&mut self) -> Result<(), Self::Error> { | ||
| 1029 | self.blocking_flush() | ||
| 1030 | } | ||
| 1031 | } | 1034 | } |
| 1035 | } | ||
| 1032 | 1036 | ||
| 1033 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_02::serial::Read<u8> for Uart<'d, T, TxDma, RxDma> { | 1037 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_02::blocking::serial::Write<u8> for Uart<'d, T, TxDma, RxDma> { |
| 1034 | type Error = Error; | 1038 | type Error = Error; |
| 1035 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 1039 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { |
| 1036 | self.nb_read() | 1040 | self.blocking_write(buffer) |
| 1037 | } | 1041 | } |
| 1042 | fn bflush(&mut self) -> Result<(), Self::Error> { | ||
| 1043 | self.blocking_flush() | ||
| 1038 | } | 1044 | } |
| 1045 | } | ||
| 1039 | 1046 | ||
| 1040 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_02::blocking::serial::Write<u8> for Uart<'d, T, TxDma, RxDma> { | 1047 | impl embedded_hal_nb::serial::Error for Error { |
| 1041 | type Error = Error; | 1048 | fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { |
| 1042 | fn bwrite_all(&mut self, buffer: &[u8]) -> Result<(), Self::Error> { | 1049 | match *self { |
| 1043 | self.blocking_write(buffer) | 1050 | Self::Framing => embedded_hal_nb::serial::ErrorKind::FrameFormat, |
| 1044 | } | 1051 | Self::Noise => embedded_hal_nb::serial::ErrorKind::Noise, |
| 1045 | fn bflush(&mut self) -> Result<(), Self::Error> { | 1052 | Self::Overrun => embedded_hal_nb::serial::ErrorKind::Overrun, |
| 1046 | self.blocking_flush() | 1053 | Self::Parity => embedded_hal_nb::serial::ErrorKind::Parity, |
| 1054 | Self::BufferTooLong => embedded_hal_nb::serial::ErrorKind::Other, | ||
| 1047 | } | 1055 | } |
| 1048 | } | 1056 | } |
| 1049 | } | 1057 | } |
| 1050 | 1058 | ||
| 1051 | #[cfg(feature = "unstable-traits")] | 1059 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::ErrorType for Uart<'d, T, TxDma, RxDma> { |
| 1052 | mod eh1 { | 1060 | type Error = Error; |
| 1053 | use super::*; | 1061 | } |
| 1054 | 1062 | ||
| 1055 | impl embedded_hal_nb::serial::Error for Error { | 1063 | impl<'d, T: BasicInstance, TxDma> embedded_hal_nb::serial::ErrorType for UartTx<'d, T, TxDma> { |
| 1056 | fn kind(&self) -> embedded_hal_nb::serial::ErrorKind { | 1064 | type Error = Error; |
| 1057 | match *self { | 1065 | } |
| 1058 | Self::Framing => embedded_hal_nb::serial::ErrorKind::FrameFormat, | ||
| 1059 | Self::Noise => embedded_hal_nb::serial::ErrorKind::Noise, | ||
| 1060 | Self::Overrun => embedded_hal_nb::serial::ErrorKind::Overrun, | ||
| 1061 | Self::Parity => embedded_hal_nb::serial::ErrorKind::Parity, | ||
| 1062 | Self::BufferTooLong => embedded_hal_nb::serial::ErrorKind::Other, | ||
| 1063 | } | ||
| 1064 | } | ||
| 1065 | } | ||
| 1066 | 1066 | ||
| 1067 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::ErrorType for Uart<'d, T, TxDma, RxDma> { | 1067 | impl<'d, T: BasicInstance, RxDma> embedded_hal_nb::serial::ErrorType for UartRx<'d, T, RxDma> { |
| 1068 | type Error = Error; | 1068 | type Error = Error; |
| 1069 | } | 1069 | } |
| 1070 | 1070 | ||
| 1071 | impl<'d, T: BasicInstance, TxDma> embedded_hal_nb::serial::ErrorType for UartTx<'d, T, TxDma> { | 1071 | impl<'d, T: BasicInstance, RxDma> embedded_hal_nb::serial::Read for UartRx<'d, T, RxDma> { |
| 1072 | type Error = Error; | 1072 | fn read(&mut self) -> nb::Result<u8, Self::Error> { |
| 1073 | self.nb_read() | ||
| 1073 | } | 1074 | } |
| 1075 | } | ||
| 1074 | 1076 | ||
| 1075 | impl<'d, T: BasicInstance, RxDma> embedded_hal_nb::serial::ErrorType for UartRx<'d, T, RxDma> { | 1077 | impl<'d, T: BasicInstance, TxDma> embedded_hal_nb::serial::Write for UartTx<'d, T, TxDma> { |
| 1076 | type Error = Error; | 1078 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 1079 | self.blocking_write(&[char]).map_err(nb::Error::Other) | ||
| 1077 | } | 1080 | } |
| 1078 | 1081 | ||
| 1079 | impl<'d, T: BasicInstance, RxDma> embedded_hal_nb::serial::Read for UartRx<'d, T, RxDma> { | 1082 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 1080 | fn read(&mut self) -> nb::Result<u8, Self::Error> { | 1083 | self.blocking_flush().map_err(nb::Error::Other) |
| 1081 | self.nb_read() | ||
| 1082 | } | ||
| 1083 | } | 1084 | } |
| 1085 | } | ||
| 1084 | 1086 | ||
| 1085 | impl<'d, T: BasicInstance, TxDma> embedded_hal_nb::serial::Write for UartTx<'d, T, TxDma> { | 1087 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::Read for Uart<'d, T, TxDma, RxDma> { |
| 1086 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 1088 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
| 1087 | self.blocking_write(&[char]).map_err(nb::Error::Other) | 1089 | self.nb_read() |
| 1088 | } | ||
| 1089 | |||
| 1090 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | ||
| 1091 | self.blocking_flush().map_err(nb::Error::Other) | ||
| 1092 | } | ||
| 1093 | } | 1090 | } |
| 1091 | } | ||
| 1094 | 1092 | ||
| 1095 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::Read for Uart<'d, T, TxDma, RxDma> { | 1093 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::Write for Uart<'d, T, TxDma, RxDma> { |
| 1096 | fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { | 1094 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { |
| 1097 | self.nb_read() | 1095 | self.blocking_write(&[char]).map_err(nb::Error::Other) |
| 1098 | } | ||
| 1099 | } | 1096 | } |
| 1100 | 1097 | ||
| 1101 | impl<'d, T: BasicInstance, TxDma, RxDma> embedded_hal_nb::serial::Write for Uart<'d, T, TxDma, RxDma> { | 1098 | fn flush(&mut self) -> nb::Result<(), Self::Error> { |
| 1102 | fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { | 1099 | self.blocking_flush().map_err(nb::Error::Other) |
| 1103 | self.blocking_write(&[char]).map_err(nb::Error::Other) | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | fn flush(&mut self) -> nb::Result<(), Self::Error> { | ||
| 1107 | self.blocking_flush().map_err(nb::Error::Other) | ||
| 1108 | } | ||
| 1109 | } | 1100 | } |
| 1110 | } | 1101 | } |
| 1111 | 1102 | ||
| @@ -1159,47 +1150,39 @@ where | |||
| 1159 | } | 1150 | } |
| 1160 | } | 1151 | } |
| 1161 | 1152 | ||
| 1162 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 1153 | impl<T, TxDma, RxDma> embedded_io_async::Write for Uart<'_, T, TxDma, RxDma> |
| 1163 | mod eio { | 1154 | where |
| 1164 | use super::*; | 1155 | T: BasicInstance, |
| 1165 | 1156 | TxDma: self::TxDma<T>, | |
| 1166 | impl<T, TxDma, RxDma> embedded_io_async::Write for Uart<'_, T, TxDma, RxDma> | 1157 | { |
| 1167 | where | 1158 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 1168 | T: BasicInstance, | 1159 | self.write(buf).await?; |
| 1169 | TxDma: super::TxDma<T>, | 1160 | Ok(buf.len()) |
| 1170 | { | 1161 | } |
| 1171 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | ||
| 1172 | self.write(buf).await?; | ||
| 1173 | Ok(buf.len()) | ||
| 1174 | } | ||
| 1175 | 1162 | ||
| 1176 | async fn flush(&mut self) -> Result<(), Self::Error> { | 1163 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 1177 | self.blocking_flush() | 1164 | self.blocking_flush() |
| 1178 | } | ||
| 1179 | } | 1165 | } |
| 1166 | } | ||
| 1180 | 1167 | ||
| 1181 | impl<T, TxDma> embedded_io_async::Write for UartTx<'_, T, TxDma> | 1168 | impl<T, TxDma> embedded_io_async::Write for UartTx<'_, T, TxDma> |
| 1182 | where | 1169 | where |
| 1183 | T: BasicInstance, | 1170 | T: BasicInstance, |
| 1184 | TxDma: super::TxDma<T>, | 1171 | TxDma: self::TxDma<T>, |
| 1185 | { | 1172 | { |
| 1186 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 1173 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 1187 | self.write(buf).await?; | 1174 | self.write(buf).await?; |
| 1188 | Ok(buf.len()) | 1175 | Ok(buf.len()) |
| 1189 | } | 1176 | } |
| 1190 | 1177 | ||
| 1191 | async fn flush(&mut self) -> Result<(), Self::Error> { | 1178 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 1192 | self.blocking_flush() | 1179 | self.blocking_flush() |
| 1193 | } | ||
| 1194 | } | 1180 | } |
| 1195 | } | 1181 | } |
| 1196 | 1182 | ||
| 1197 | #[cfg(feature = "nightly")] | ||
| 1198 | pub use buffered::*; | 1183 | pub use buffered::*; |
| 1199 | 1184 | ||
| 1200 | #[cfg(feature = "nightly")] | ||
| 1201 | pub use crate::usart::buffered::InterruptHandler as BufferedInterruptHandler; | 1185 | pub use crate::usart::buffered::InterruptHandler as BufferedInterruptHandler; |
| 1202 | #[cfg(feature = "nightly")] | ||
| 1203 | mod buffered; | 1186 | mod buffered; |
| 1204 | 1187 | ||
| 1205 | #[cfg(not(gpdma))] | 1188 | #[cfg(not(gpdma))] |
| @@ -1284,7 +1267,6 @@ pub(crate) mod sealed { | |||
| 1284 | fn regs() -> Regs; | 1267 | fn regs() -> Regs; |
| 1285 | fn state() -> &'static State; | 1268 | fn state() -> &'static State; |
| 1286 | 1269 | ||
| 1287 | #[cfg(feature = "nightly")] | ||
| 1288 | fn buffered_state() -> &'static buffered::State; | 1270 | fn buffered_state() -> &'static buffered::State; |
| 1289 | } | 1271 | } |
| 1290 | 1272 | ||
| @@ -1322,7 +1304,6 @@ macro_rules! impl_usart { | |||
| 1322 | &STATE | 1304 | &STATE |
| 1323 | } | 1305 | } |
| 1324 | 1306 | ||
| 1325 | #[cfg(feature = "nightly")] | ||
| 1326 | fn buffered_state() -> &'static buffered::State { | 1307 | fn buffered_state() -> &'static buffered::State { |
| 1327 | static STATE: buffered::State = buffered::State::new(); | 1308 | static STATE: buffered::State = buffered::State::new(); |
| 1328 | &STATE | 1309 | &STATE |
diff --git a/embassy-stm32/src/usart/ringbuffered.rs b/embassy-stm32/src/usart/ringbuffered.rs index eceabbe9a..b8d17e4e4 100644 --- a/embassy-stm32/src/usart/ringbuffered.rs +++ b/embassy-stm32/src/usart/ringbuffered.rs | |||
| @@ -7,7 +7,7 @@ use embassy_embedded_hal::SetConfig; | |||
| 7 | use embassy_hal_internal::PeripheralRef; | 7 | use embassy_hal_internal::PeripheralRef; |
| 8 | use futures::future::{select, Either}; | 8 | use futures::future::{select, Either}; |
| 9 | 9 | ||
| 10 | use super::{clear_interrupt_flags, rdr, reconfigure, sr, BasicInstance, Config, ConfigError, Error, UartRx}; | 10 | use super::{clear_interrupt_flags, rdr, reconfigure, sr, BasicInstance, Config, ConfigError, Error, RxDma, UartRx}; |
| 11 | use crate::dma::ReadableRingBuffer; | 11 | use crate::dma::ReadableRingBuffer; |
| 12 | use crate::usart::{Regs, Sr}; | 12 | use crate::usart::{Regs, Sr}; |
| 13 | 13 | ||
| @@ -240,28 +240,20 @@ fn clear_idle_flag(r: Regs) -> Sr { | |||
| 240 | sr | 240 | sr |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 243 | impl<T, Rx> embedded_io_async::ErrorType for RingBufferedUartRx<'_, T, Rx> |
| 244 | mod eio { | 244 | where |
| 245 | use embedded_io_async::{ErrorType, Read}; | 245 | T: BasicInstance, |
| 246 | 246 | Rx: RxDma<T>, | |
| 247 | use super::RingBufferedUartRx; | 247 | { |
| 248 | use crate::usart::{BasicInstance, Error, RxDma}; | 248 | type Error = Error; |
| 249 | 249 | } | |
| 250 | impl<T, Rx> ErrorType for RingBufferedUartRx<'_, T, Rx> | ||
| 251 | where | ||
| 252 | T: BasicInstance, | ||
| 253 | Rx: RxDma<T>, | ||
| 254 | { | ||
| 255 | type Error = Error; | ||
| 256 | } | ||
| 257 | 250 | ||
| 258 | impl<T, Rx> Read for RingBufferedUartRx<'_, T, Rx> | 251 | impl<T, Rx> embedded_io_async::Read for RingBufferedUartRx<'_, T, Rx> |
| 259 | where | 252 | where |
| 260 | T: BasicInstance, | 253 | T: BasicInstance, |
| 261 | Rx: RxDma<T>, | 254 | Rx: RxDma<T>, |
| 262 | { | 255 | { |
| 263 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 256 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 264 | self.read(buf).await | 257 | self.read(buf).await |
| 265 | } | ||
| 266 | } | 258 | } |
| 267 | } | 259 | } |
diff --git a/embassy-stm32/src/usb/mod.rs b/embassy-stm32/src/usb/mod.rs index bee287fe6..d0b289462 100644 --- a/embassy-stm32/src/usb/mod.rs +++ b/embassy-stm32/src/usb/mod.rs | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | use crate::interrupt; | 1 | use crate::interrupt; |
| 2 | use crate::rcc::RccPeripheral; | 2 | use crate::rcc::RccPeripheral; |
| 3 | 3 | ||
| 4 | #[cfg(feature = "nightly")] | ||
| 5 | mod usb; | 4 | mod usb; |
| 6 | #[cfg(feature = "nightly")] | ||
| 7 | pub use usb::*; | 5 | pub use usb::*; |
| 8 | 6 | ||
| 9 | pub(crate) mod sealed { | 7 | pub(crate) mod sealed { |
diff --git a/embassy-stm32/src/usb_otg/mod.rs b/embassy-stm32/src/usb_otg/mod.rs index 12e5f0e60..be54a3d10 100644 --- a/embassy-stm32/src/usb_otg/mod.rs +++ b/embassy-stm32/src/usb_otg/mod.rs | |||
| @@ -1,13 +1,10 @@ | |||
| 1 | use crate::rcc::RccPeripheral; | 1 | use crate::rcc::RccPeripheral; |
| 2 | use crate::{interrupt, peripherals}; | 2 | use crate::{interrupt, peripherals}; |
| 3 | 3 | ||
| 4 | #[cfg(feature = "nightly")] | ||
| 5 | mod usb; | 4 | mod usb; |
| 6 | #[cfg(feature = "nightly")] | ||
| 7 | pub use usb::*; | 5 | pub use usb::*; |
| 8 | 6 | ||
| 9 | // Using Instance::ENDPOINT_COUNT requires feature(const_generic_expr) so just define maximum eps | 7 | // Using Instance::ENDPOINT_COUNT requires feature(const_generic_expr) so just define maximum eps |
| 10 | #[cfg(feature = "nightly")] | ||
| 11 | const MAX_EP_COUNT: usize = 9; | 8 | const MAX_EP_COUNT: usize = 9; |
| 12 | 9 | ||
| 13 | pub(crate) mod sealed { | 10 | pub(crate) mod sealed { |
| @@ -17,7 +14,6 @@ pub(crate) mod sealed { | |||
| 17 | const ENDPOINT_COUNT: usize; | 14 | const ENDPOINT_COUNT: usize; |
| 18 | 15 | ||
| 19 | fn regs() -> crate::pac::otg::Otg; | 16 | fn regs() -> crate::pac::otg::Otg; |
| 20 | #[cfg(feature = "nightly")] | ||
| 21 | fn state() -> &'static super::State<{ super::MAX_EP_COUNT }>; | 17 | fn state() -> &'static super::State<{ super::MAX_EP_COUNT }>; |
| 22 | } | 18 | } |
| 23 | } | 19 | } |
| @@ -99,8 +95,7 @@ foreach_interrupt!( | |||
| 99 | crate::pac::USB_OTG_FS | 95 | crate::pac::USB_OTG_FS |
| 100 | } | 96 | } |
| 101 | 97 | ||
| 102 | #[cfg(feature = "nightly")] | 98 | fn state() -> &'static State<MAX_EP_COUNT> { |
| 103 | fn state() -> &'static State<MAX_EP_COUNT> { | ||
| 104 | static STATE: State<MAX_EP_COUNT> = State::new(); | 99 | static STATE: State<MAX_EP_COUNT> = State::new(); |
| 105 | &STATE | 100 | &STATE |
| 106 | } | 101 | } |
| @@ -151,8 +146,7 @@ foreach_interrupt!( | |||
| 151 | unsafe { crate::pac::otg::Otg::from_ptr(crate::pac::USB_OTG_HS.as_ptr()) } | 146 | unsafe { crate::pac::otg::Otg::from_ptr(crate::pac::USB_OTG_HS.as_ptr()) } |
| 152 | } | 147 | } |
| 153 | 148 | ||
| 154 | #[cfg(feature = "nightly")] | 149 | fn state() -> &'static State<MAX_EP_COUNT> { |
| 155 | fn state() -> &'static State<MAX_EP_COUNT> { | ||
| 156 | static STATE: State<MAX_EP_COUNT> = State::new(); | 150 | static STATE: State<MAX_EP_COUNT> = State::new(); |
| 157 | &STATE | 151 | &STATE |
| 158 | } | 152 | } |
diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml index ffcd13d9f..6588406a1 100644 --- a/embassy-sync/Cargo.toml +++ b/embassy-sync/Cargo.toml | |||
| @@ -16,14 +16,9 @@ categories = [ | |||
| 16 | [package.metadata.embassy_docs] | 16 | [package.metadata.embassy_docs] |
| 17 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-sync-v$VERSION/embassy-sync/src/" | 17 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-sync-v$VERSION/embassy-sync/src/" |
| 18 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/src/" | 18 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/src/" |
| 19 | features = ["nightly"] | ||
| 20 | target = "thumbv7em-none-eabi" | 19 | target = "thumbv7em-none-eabi" |
| 21 | 20 | ||
| 22 | [package.metadata.docs.rs] | ||
| 23 | features = ["nightly"] | ||
| 24 | |||
| 25 | [features] | 21 | [features] |
| 26 | nightly = ["dep:embedded-io-async"] | ||
| 27 | std = [] | 22 | std = [] |
| 28 | turbowakers = [] | 23 | turbowakers = [] |
| 29 | 24 | ||
| @@ -35,7 +30,7 @@ futures-util = { version = "0.3.17", default-features = false } | |||
| 35 | critical-section = "1.1" | 30 | critical-section = "1.1" |
| 36 | heapless = "0.8" | 31 | heapless = "0.8" |
| 37 | cfg-if = "1.0.0" | 32 | cfg-if = "1.0.0" |
| 38 | embedded-io-async = { version = "0.6.1", optional = true } | 33 | embedded-io-async = { version = "0.6.1" } |
| 39 | 34 | ||
| 40 | [dev-dependencies] | 35 | [dev-dependencies] |
| 41 | futures-executor = { version = "0.3.17", features = [ "thread-pool" ] } | 36 | futures-executor = { version = "0.3.17", features = [ "thread-pool" ] } |
diff --git a/embassy-sync/build.rs b/embassy-sync/build.rs index 6fe82b44f..0a796b881 100644 --- a/embassy-sync/build.rs +++ b/embassy-sync/build.rs | |||
| @@ -1,6 +1,21 @@ | |||
| 1 | use std::env; | 1 | use std::env; |
| 2 | use std::ffi::OsString; | ||
| 3 | use std::process::Command; | ||
| 2 | 4 | ||
| 3 | fn main() { | 5 | fn main() { |
| 6 | println!("cargo:rerun-if-changed=build.rs"); | ||
| 7 | |||
| 8 | let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); | ||
| 9 | |||
| 10 | let output = Command::new(rustc) | ||
| 11 | .arg("--version") | ||
| 12 | .output() | ||
| 13 | .expect("failed to run `rustc --version`"); | ||
| 14 | |||
| 15 | if String::from_utf8_lossy(&output.stdout).contains("nightly") { | ||
| 16 | println!("cargo:rustc-cfg=nightly"); | ||
| 17 | } | ||
| 18 | |||
| 4 | let target = env::var("TARGET").unwrap(); | 19 | let target = env::var("TARGET").unwrap(); |
| 5 | 20 | ||
| 6 | if target.starts_with("thumbv6m-") { | 21 | if target.starts_with("thumbv6m-") { |
diff --git a/embassy-sync/src/lib.rs b/embassy-sync/src/lib.rs index 3ffcb9135..b0ccfde57 100644 --- a/embassy-sync/src/lib.rs +++ b/embassy-sync/src/lib.rs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #![cfg_attr(not(any(feature = "std", feature = "wasm")), no_std)] | 1 | #![cfg_attr(not(any(feature = "std", feature = "wasm")), no_std)] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))] | 2 | #![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | 3 | #![cfg_attr(nightly, allow(stable_features, unknown_lints))] |
| 4 | #![allow(async_fn_in_trait)] | ||
| 4 | #![allow(clippy::new_without_default)] | 5 | #![allow(clippy::new_without_default)] |
| 5 | #![doc = include_str!("../README.md")] | 6 | #![doc = include_str!("../README.md")] |
| 6 | #![warn(missing_docs)] | 7 | #![warn(missing_docs)] |
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs index ec0cbbf2a..42fe8ebd0 100644 --- a/embassy-sync/src/pipe.rs +++ b/embassy-sync/src/pipe.rs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | //! Async byte stream pipe. | 1 | //! Async byte stream pipe. |
| 2 | 2 | ||
| 3 | use core::cell::{RefCell, UnsafeCell}; | 3 | use core::cell::{RefCell, UnsafeCell}; |
| 4 | use core::convert::Infallible; | ||
| 4 | use core::future::Future; | 5 | use core::future::Future; |
| 5 | use core::ops::Range; | 6 | use core::ops::Range; |
| 6 | use core::pin::Pin; | 7 | use core::pin::Pin; |
| @@ -457,84 +458,77 @@ where | |||
| 457 | } | 458 | } |
| 458 | } | 459 | } |
| 459 | 460 | ||
| 460 | #[cfg(feature = "nightly")] | 461 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Pipe<M, N> { |
| 461 | mod io_impls { | 462 | type Error = Infallible; |
| 462 | use core::convert::Infallible; | 463 | } |
| 463 | 464 | ||
| 464 | use super::*; | 465 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Pipe<M, N> { |
| 466 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | ||
| 467 | Ok(Pipe::read(self, buf).await) | ||
| 468 | } | ||
| 469 | } | ||
| 465 | 470 | ||
| 466 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Pipe<M, N> { | 471 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Pipe<M, N> { |
| 467 | type Error = Infallible; | 472 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 473 | Ok(Pipe::write(self, buf).await) | ||
| 468 | } | 474 | } |
| 469 | 475 | ||
| 470 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Pipe<M, N> { | 476 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 471 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 477 | Ok(()) |
| 472 | Ok(Pipe::read(self, buf).await) | ||
| 473 | } | ||
| 474 | } | 478 | } |
| 479 | } | ||
| 475 | 480 | ||
| 476 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Pipe<M, N> { | 481 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for &Pipe<M, N> { |
| 477 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 482 | type Error = Infallible; |
| 478 | Ok(Pipe::write(self, buf).await) | 483 | } |
| 479 | } | ||
| 480 | 484 | ||
| 481 | async fn flush(&mut self) -> Result<(), Self::Error> { | 485 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for &Pipe<M, N> { |
| 482 | Ok(()) | 486 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 483 | } | 487 | Ok(Pipe::read(self, buf).await) |
| 484 | } | 488 | } |
| 489 | } | ||
| 485 | 490 | ||
| 486 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for &Pipe<M, N> { | 491 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for &Pipe<M, N> { |
| 487 | type Error = Infallible; | 492 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 493 | Ok(Pipe::write(self, buf).await) | ||
| 488 | } | 494 | } |
| 489 | 495 | ||
| 490 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for &Pipe<M, N> { | 496 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 491 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 497 | Ok(()) |
| 492 | Ok(Pipe::read(self, buf).await) | ||
| 493 | } | ||
| 494 | } | 498 | } |
| 499 | } | ||
| 495 | 500 | ||
| 496 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for &Pipe<M, N> { | 501 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Reader<'_, M, N> { |
| 497 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 502 | type Error = Infallible; |
| 498 | Ok(Pipe::write(self, buf).await) | 503 | } |
| 499 | } | ||
| 500 | 504 | ||
| 501 | async fn flush(&mut self) -> Result<(), Self::Error> { | 505 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Reader<'_, M, N> { |
| 502 | Ok(()) | 506 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 503 | } | 507 | Ok(Reader::read(self, buf).await) |
| 504 | } | 508 | } |
| 509 | } | ||
| 505 | 510 | ||
| 506 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Reader<'_, M, N> { | 511 | impl<M: RawMutex, const N: usize> embedded_io_async::BufRead for Reader<'_, M, N> { |
| 507 | type Error = Infallible; | 512 | async fn fill_buf(&mut self) -> Result<&[u8], Self::Error> { |
| 513 | Ok(Reader::fill_buf(self).await) | ||
| 508 | } | 514 | } |
| 509 | 515 | ||
| 510 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Reader<'_, M, N> { | 516 | fn consume(&mut self, amt: usize) { |
| 511 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 517 | Reader::consume(self, amt) |
| 512 | Ok(Reader::read(self, buf).await) | ||
| 513 | } | ||
| 514 | } | 518 | } |
| 519 | } | ||
| 515 | 520 | ||
| 516 | impl<M: RawMutex, const N: usize> embedded_io_async::BufRead for Reader<'_, M, N> { | 521 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Writer<'_, M, N> { |
| 517 | async fn fill_buf(&mut self) -> Result<&[u8], Self::Error> { | 522 | type Error = Infallible; |
| 518 | Ok(Reader::fill_buf(self).await) | 523 | } |
| 519 | } | ||
| 520 | |||
| 521 | fn consume(&mut self, amt: usize) { | ||
| 522 | Reader::consume(self, amt) | ||
| 523 | } | ||
| 524 | } | ||
| 525 | 524 | ||
| 526 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Writer<'_, M, N> { | 525 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Writer<'_, M, N> { |
| 527 | type Error = Infallible; | 526 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 527 | Ok(Writer::write(self, buf).await) | ||
| 528 | } | 528 | } |
| 529 | 529 | ||
| 530 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Writer<'_, M, N> { | 530 | async fn flush(&mut self) -> Result<(), Self::Error> { |
| 531 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 531 | Ok(()) |
| 532 | Ok(Writer::write(self, buf).await) | ||
| 533 | } | ||
| 534 | |||
| 535 | async fn flush(&mut self) -> Result<(), Self::Error> { | ||
| 536 | Ok(()) | ||
| 537 | } | ||
| 538 | } | 532 | } |
| 539 | } | 533 | } |
| 540 | 534 | ||
diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 570e0efa7..5cbb44b33 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml | |||
| @@ -22,23 +22,16 @@ links = "embassy-time" | |||
| 22 | [package.metadata.embassy_docs] | 22 | [package.metadata.embassy_docs] |
| 23 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-v$VERSION/embassy-time/src/" | 23 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-v$VERSION/embassy-time/src/" |
| 24 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-time/src/" | 24 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-time/src/" |
| 25 | features = ["nightly", "defmt", "unstable-traits", "std"] | 25 | features = ["defmt", "std"] |
| 26 | target = "x86_64-unknown-linux-gnu" | 26 | target = "x86_64-unknown-linux-gnu" |
| 27 | 27 | ||
| 28 | [package.metadata.docs.rs] | 28 | [package.metadata.docs.rs] |
| 29 | features = ["nightly", "defmt", "unstable-traits", "std"] | 29 | features = ["defmt", "std"] |
| 30 | 30 | ||
| 31 | [features] | 31 | [features] |
| 32 | std = ["tick-hz-1_000_000", "critical-section/std"] | 32 | std = ["tick-hz-1_000_000", "critical-section/std"] |
| 33 | wasm = ["dep:wasm-bindgen", "dep:js-sys", "dep:wasm-timer", "tick-hz-1_000_000"] | 33 | wasm = ["dep:wasm-bindgen", "dep:js-sys", "dep:wasm-timer", "tick-hz-1_000_000"] |
| 34 | 34 | ||
| 35 | # Enable nightly-only features | ||
| 36 | nightly = ["embedded-hal-async"] | ||
| 37 | |||
| 38 | # Implement embedded-hal 1.0 alpha and embedded-hal-async traits. | ||
| 39 | # Implement embedded-hal-async traits if `nightly` is set as well. | ||
| 40 | unstable-traits = ["embedded-hal-1"] | ||
| 41 | |||
| 42 | # Display a timestamp of the number of seconds since startup next to defmt log messages | 35 | # Display a timestamp of the number of seconds since startup next to defmt log messages |
| 43 | # To use this you must have a time driver provided. | 36 | # To use this you must have a time driver provided. |
| 44 | defmt-timestamp-uptime = ["defmt"] | 37 | defmt-timestamp-uptime = ["defmt"] |
| @@ -242,8 +235,8 @@ defmt = { version = "0.3", optional = true } | |||
| 242 | log = { version = "0.4.14", optional = true } | 235 | log = { version = "0.4.14", optional = true } |
| 243 | 236 | ||
| 244 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6" } | 237 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6" } |
| 245 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2", optional = true} | 238 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 246 | embedded-hal-async = { version = "=1.0.0-rc.2", optional = true} | 239 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 247 | 240 | ||
| 248 | futures-util = { version = "0.3.17", default-features = false } | 241 | futures-util = { version = "0.3.17", default-features = false } |
| 249 | critical-section = "1.1" | 242 | critical-section = "1.1" |
| @@ -258,4 +251,4 @@ wasm-timer = { version = "0.2.5", optional = true } | |||
| 258 | [dev-dependencies] | 251 | [dev-dependencies] |
| 259 | serial_test = "0.9" | 252 | serial_test = "0.9" |
| 260 | critical-section = { version = "1.1", features = ["std"] } | 253 | critical-section = { version = "1.1", features = ["std"] } |
| 261 | embassy-executor = { version = "0.3.3", path = "../embassy-executor", features = ["nightly"] } | 254 | embassy-executor = { version = "0.3.3", path = "../embassy-executor" } |
diff --git a/embassy-time/build.rs b/embassy-time/build.rs index 5b0095661..78bd27ec7 100644 --- a/embassy-time/build.rs +++ b/embassy-time/build.rs | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | // empty, needed to be able to use `links` in Cargo.toml. | 1 | use std::env; |
| 2 | use std::ffi::OsString; | ||
| 3 | use std::process::Command; | ||
| 2 | 4 | ||
| 3 | fn main() {} | 5 | fn main() { |
| 6 | println!("cargo:rerun-if-changed=build.rs"); | ||
| 7 | |||
| 8 | let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); | ||
| 9 | |||
| 10 | let output = Command::new(rustc) | ||
| 11 | .arg("--version") | ||
| 12 | .output() | ||
| 13 | .expect("failed to run `rustc --version`"); | ||
| 14 | |||
| 15 | if String::from_utf8_lossy(&output.stdout).contains("nightly") { | ||
| 16 | println!("cargo:rustc-cfg=nightly"); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/embassy-time/src/delay.rs b/embassy-time/src/delay.rs index aab56b1f1..7ef5961f0 100644 --- a/embassy-time/src/delay.rs +++ b/embassy-time/src/delay.rs | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | use super::{Duration, Instant}; | 1 | use super::{Duration, Instant}; |
| 2 | use crate::Timer; | ||
| 2 | 3 | ||
| 3 | /// Blocks for at least `duration`. | 4 | /// Blocks for at least `duration`. |
| 4 | pub fn block_for(duration: Duration) { | 5 | pub fn block_for(duration: Duration) { |
| @@ -14,83 +15,66 @@ pub fn block_for(duration: Duration) { | |||
| 14 | /// active driver. | 15 | /// active driver. |
| 15 | pub struct Delay; | 16 | pub struct Delay; |
| 16 | 17 | ||
| 17 | #[cfg(feature = "unstable-traits")] | 18 | impl embedded_hal_1::delay::DelayNs for Delay { |
| 18 | mod eh1 { | 19 | fn delay_ns(&mut self, ns: u32) { |
| 19 | use super::*; | 20 | block_for(Duration::from_nanos(ns as u64)) |
| 20 | 21 | } | |
| 21 | impl embedded_hal_1::delay::DelayNs for Delay { | ||
| 22 | fn delay_ns(&mut self, ns: u32) { | ||
| 23 | block_for(Duration::from_nanos(ns as u64)) | ||
| 24 | } | ||
| 25 | 22 | ||
| 26 | fn delay_us(&mut self, us: u32) { | 23 | fn delay_us(&mut self, us: u32) { |
| 27 | block_for(Duration::from_micros(us as u64)) | 24 | block_for(Duration::from_micros(us as u64)) |
| 28 | } | 25 | } |
| 29 | 26 | ||
| 30 | fn delay_ms(&mut self, ms: u32) { | 27 | fn delay_ms(&mut self, ms: u32) { |
| 31 | block_for(Duration::from_millis(ms as u64)) | 28 | block_for(Duration::from_millis(ms as u64)) |
| 32 | } | ||
| 33 | } | 29 | } |
| 34 | } | 30 | } |
| 35 | 31 | ||
| 36 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 32 | impl embedded_hal_async::delay::DelayNs for Delay { |
| 37 | mod eha { | 33 | async fn delay_ns(&mut self, ns: u32) { |
| 38 | use super::*; | 34 | Timer::after_nanos(ns as _).await |
| 39 | use crate::Timer; | 35 | } |
| 40 | |||
| 41 | impl embedded_hal_async::delay::DelayNs for Delay { | ||
| 42 | async fn delay_ns(&mut self, ns: u32) { | ||
| 43 | Timer::after_nanos(ns as _).await | ||
| 44 | } | ||
| 45 | 36 | ||
| 46 | async fn delay_us(&mut self, us: u32) { | 37 | async fn delay_us(&mut self, us: u32) { |
| 47 | Timer::after_micros(us as _).await | 38 | Timer::after_micros(us as _).await |
| 48 | } | 39 | } |
| 49 | 40 | ||
| 50 | async fn delay_ms(&mut self, ms: u32) { | 41 | async fn delay_ms(&mut self, ms: u32) { |
| 51 | Timer::after_millis(ms as _).await | 42 | Timer::after_millis(ms as _).await |
| 52 | } | ||
| 53 | } | 43 | } |
| 54 | } | 44 | } |
| 55 | 45 | ||
| 56 | mod eh02 { | 46 | impl embedded_hal_02::blocking::delay::DelayMs<u8> for Delay { |
| 57 | use embedded_hal_02::blocking::delay::{DelayMs, DelayUs}; | 47 | fn delay_ms(&mut self, ms: u8) { |
| 58 | 48 | block_for(Duration::from_millis(ms as u64)) | |
| 59 | use super::*; | ||
| 60 | |||
| 61 | impl DelayMs<u8> for Delay { | ||
| 62 | fn delay_ms(&mut self, ms: u8) { | ||
| 63 | block_for(Duration::from_millis(ms as u64)) | ||
| 64 | } | ||
| 65 | } | 49 | } |
| 50 | } | ||
| 66 | 51 | ||
| 67 | impl DelayMs<u16> for Delay { | 52 | impl embedded_hal_02::blocking::delay::DelayMs<u16> for Delay { |
| 68 | fn delay_ms(&mut self, ms: u16) { | 53 | fn delay_ms(&mut self, ms: u16) { |
| 69 | block_for(Duration::from_millis(ms as u64)) | 54 | block_for(Duration::from_millis(ms as u64)) |
| 70 | } | ||
| 71 | } | 55 | } |
| 56 | } | ||
| 72 | 57 | ||
| 73 | impl DelayMs<u32> for Delay { | 58 | impl embedded_hal_02::blocking::delay::DelayMs<u32> for Delay { |
| 74 | fn delay_ms(&mut self, ms: u32) { | 59 | fn delay_ms(&mut self, ms: u32) { |
| 75 | block_for(Duration::from_millis(ms as u64)) | 60 | block_for(Duration::from_millis(ms as u64)) |
| 76 | } | ||
| 77 | } | 61 | } |
| 62 | } | ||
| 78 | 63 | ||
| 79 | impl DelayUs<u8> for Delay { | 64 | impl embedded_hal_02::blocking::delay::DelayUs<u8> for Delay { |
| 80 | fn delay_us(&mut self, us: u8) { | 65 | fn delay_us(&mut self, us: u8) { |
| 81 | block_for(Duration::from_micros(us as u64)) | 66 | block_for(Duration::from_micros(us as u64)) |
| 82 | } | ||
| 83 | } | 67 | } |
| 68 | } | ||
| 84 | 69 | ||
| 85 | impl DelayUs<u16> for Delay { | 70 | impl embedded_hal_02::blocking::delay::DelayUs<u16> for Delay { |
| 86 | fn delay_us(&mut self, us: u16) { | 71 | fn delay_us(&mut self, us: u16) { |
| 87 | block_for(Duration::from_micros(us as u64)) | 72 | block_for(Duration::from_micros(us as u64)) |
| 88 | } | ||
| 89 | } | 73 | } |
| 74 | } | ||
| 90 | 75 | ||
| 91 | impl DelayUs<u32> for Delay { | 76 | impl embedded_hal_02::blocking::delay::DelayUs<u32> for Delay { |
| 92 | fn delay_us(&mut self, us: u32) { | 77 | fn delay_us(&mut self, us: u32) { |
| 93 | block_for(Duration::from_micros(us as u64)) | 78 | block_for(Duration::from_micros(us as u64)) |
| 94 | } | ||
| 95 | } | 79 | } |
| 96 | } | 80 | } |
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs index a0f6e3824..82a7ee0df 100644 --- a/embassy-time/src/lib.rs +++ b/embassy-time/src/lib.rs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #![cfg_attr(not(any(feature = "std", feature = "wasm", test)), no_std)] | 1 | #![cfg_attr(not(any(feature = "std", feature = "wasm", test)), no_std)] |
| 2 | #![cfg_attr(feature = "nightly", feature(async_fn_in_trait))] | 2 | #![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))] |
| 3 | #![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))] | 3 | #![cfg_attr(nightly, allow(stable_features, unknown_lints))] |
| 4 | #![allow(async_fn_in_trait)] | ||
| 4 | #![doc = include_str!("../README.md")] | 5 | #![doc = include_str!("../README.md")] |
| 5 | #![allow(clippy::new_without_default)] | 6 | #![allow(clippy::new_without_default)] |
| 6 | #![warn(missing_docs)] | 7 | #![warn(missing_docs)] |
diff --git a/embassy-usb-driver/src/lib.rs b/embassy-usb-driver/src/lib.rs index 9c2dddda5..3b705c8c4 100644 --- a/embassy-usb-driver/src/lib.rs +++ b/embassy-usb-driver/src/lib.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![feature(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 4 | #![doc = include_str!("../README.md")] | 3 | #![doc = include_str!("../README.md")] |
| 5 | #![warn(missing_docs)] | 4 | #![warn(missing_docs)] |
| 6 | 5 | ||
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index 8489be5aa..193ca5a2a 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -7,10 +7,10 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [] } |
| 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly"] } | 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", ] } |
| 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = ["nightly"] } | 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = [] } |
| 13 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf", features = ["nightly"] } | 13 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf", features = [] } |
| 14 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 14 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 15 | 15 | ||
| 16 | defmt = { version = "0.3", optional = true } | 16 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/rp/Cargo.toml b/examples/boot/application/rp/Cargo.toml index e22d0c894..3008552e3 100644 --- a/examples/boot/application/rp/Cargo.toml +++ b/examples/boot/application/rp/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", "unstable-traits", "nightly"] } | 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", ] } |
| 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = ["nightly"] } | 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index c9cecd65b..26c46bc20 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f303re", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index 7464adcb4..a3d345b69 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f767zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 887c53b8a..56b95993c 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32h743zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index 5a2492f0f..02993e4e5 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 148adc118..771266cca 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l151cb-a", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 27e1ff9a1..d375ff251 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index 7f57eb888..05f48c7de 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wl55jc-cm4", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml index db0ffaec0..a639d57f0 100644 --- a/examples/boot/bootloader/nrf/Cargo.toml +++ b/examples/boot/bootloader/nrf/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | defmt = { version = "0.3", optional = true } | 9 | defmt = { version = "0.3", optional = true } |
| 10 | defmt-rtt = { version = "0.4", optional = true } | 10 | defmt-rtt = { version = "0.4", optional = true } |
| 11 | 11 | ||
| 12 | embassy-nrf = { path = "../../../../embassy-nrf", features = ["nightly"] } | 12 | embassy-nrf = { path = "../../../../embassy-nrf", features = [] } |
| 13 | embassy-boot-nrf = { path = "../../../../embassy-boot/nrf" } | 13 | embassy-boot-nrf = { path = "../../../../embassy-boot/nrf" } |
| 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 15 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 15 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index b139a4b56..14297c7e4 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml | |||
| @@ -9,10 +9,10 @@ license = "MIT OR Apache-2.0" | |||
| 9 | defmt = { version = "0.3", optional = true } | 9 | defmt = { version = "0.3", optional = true } |
| 10 | defmt-rtt = { version = "0.4", optional = true } | 10 | defmt-rtt = { version = "0.4", optional = true } |
| 11 | 11 | ||
| 12 | embassy-rp = { path = "../../../../embassy-rp", features = ["nightly"] } | 12 | embassy-rp = { path = "../../../../embassy-rp", features = [] } |
| 13 | embassy-boot-rp = { path = "../../../../embassy-boot/rp" } | 13 | embassy-boot-rp = { path = "../../../../embassy-boot/rp" } |
| 14 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 14 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
| 15 | embassy-time = { path = "../../../../embassy-time", features = ["nightly"] } | 15 | embassy-time = { path = "../../../../embassy-time", features = [] } |
| 16 | 16 | ||
| 17 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 17 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 18 | cortex-m-rt = { version = "0.7" } | 18 | cortex-m-rt = { version = "0.7" } |
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index 4816e62ee..fb38c3a66 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | defmt = { version = "0.3", optional = true } | 9 | defmt = { version = "0.3", optional = true } |
| 10 | defmt-rtt = { version = "0.4", optional = true } | 10 | defmt-rtt = { version = "0.4", optional = true } |
| 11 | 11 | ||
| 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = ["nightly"] } | 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = [] } |
| 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32" } | 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32" } |
| 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 15 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } | 15 | embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" } |
diff --git a/examples/nrf-rtos-trace/Cargo.toml b/examples/nrf-rtos-trace/Cargo.toml index e3524deb4..c99c31aac 100644 --- a/examples/nrf-rtos-trace/Cargo.toml +++ b/examples/nrf-rtos-trace/Cargo.toml | |||
| @@ -5,8 +5,7 @@ version = "0.1.0" | |||
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [features] | 7 | [features] |
| 8 | default = ["log", "nightly"] | 8 | default = ["log"] |
| 9 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-nrf/unstable-traits"] | ||
| 10 | log = [ | 9 | log = [ |
| 11 | "dep:log", | 10 | "dep:log", |
| 12 | "embassy-sync/log", | 11 | "embassy-sync/log", |
| @@ -33,7 +32,7 @@ log = { version = "0.4.17", optional = true } | |||
| 33 | 32 | ||
| 34 | [[bin]] | 33 | [[bin]] |
| 35 | name = "rtos_trace" | 34 | name = "rtos_trace" |
| 36 | required-features = ["nightly"] | 35 | |
| 37 | 36 | ||
| 38 | [profile.release] | 37 | [profile.release] |
| 39 | debug = 2 | 38 | debug = 2 |
diff --git a/examples/nrf52840-rtic/Cargo.toml b/examples/nrf52840-rtic/Cargo.toml index 5bb8dc8ae..3448c6903 100644 --- a/examples/nrf52840-rtic/Cargo.toml +++ b/examples/nrf52840-rtic/Cargo.toml | |||
| @@ -9,8 +9,8 @@ rtic = { version = "2", features = ["thumbv7-backend"] } | |||
| 9 | 9 | ||
| 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = [ "defmt", "defmt-timestamp-uptime", "generic-queue"] } |
| 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } | 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = [ "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
| 16 | defmt-rtt = "0.4" | 16 | defmt-rtt = "0.4" |
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index d9b22a4d2..e2e79eaea 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
| @@ -7,20 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [features] | 7 | [features] |
| 8 | default = ["nightly"] | 8 | default = ["nightly"] |
| 9 | nightly = [ | 9 | nightly = [ |
| 10 | "embedded-hal-async", | ||
| 11 | "embassy-executor/nightly", | ||
| 12 | "embassy-nrf/nightly", | ||
| 13 | "embassy-net/nightly", | ||
| 14 | "embassy-net-esp-hosted", | ||
| 15 | "embassy-net-enc28j60", | ||
| 16 | "embassy-nrf/unstable-traits", | ||
| 17 | "embassy-time/nightly", | ||
| 18 | "embassy-time/unstable-traits", | ||
| 19 | "static_cell/nightly", | 10 | "static_cell/nightly", |
| 20 | "embassy-usb", | ||
| 21 | "embedded-io-async", | ||
| 22 | "embedded-hal-bus/async", | ||
| 23 | "embassy-net", | ||
| 24 | ] | 11 | ] |
| 25 | 12 | ||
| 26 | [dependencies] | 13 | [dependencies] |
| @@ -29,12 +16,12 @@ embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["de | |||
| 29 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 16 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 30 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 17 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 31 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } | 18 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } |
| 32 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], optional = true } | 19 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 33 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } | 20 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 34 | embedded-io = { version = "0.6.0", features = ["defmt-03"] } | 21 | embedded-io = { version = "0.6.0", features = ["defmt-03"] } |
| 35 | embedded-io-async = { version = "0.6.1", optional = true, features = ["defmt-03"] } | 22 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } |
| 36 | embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"], optional = true } | 23 | embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] } |
| 37 | embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"], optional = true } | 24 | embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] } |
| 38 | 25 | ||
| 39 | defmt = "0.3" | 26 | defmt = "0.3" |
| 40 | defmt-rtt = "0.4" | 27 | defmt-rtt = "0.4" |
| @@ -50,8 +37,8 @@ embedded-storage = "0.3.0" | |||
| 50 | usbd-hid = "0.6.0" | 37 | usbd-hid = "0.6.0" |
| 51 | serde = { version = "1.0.136", default-features = false } | 38 | serde = { version = "1.0.136", default-features = false } |
| 52 | embedded-hal = { version = "1.0.0-rc.2" } | 39 | embedded-hal = { version = "1.0.0-rc.2" } |
| 53 | embedded-hal-async = { version = "1.0.0-rc.2", optional = true } | 40 | embedded-hal-async = { version = "1.0.0-rc.2" } |
| 54 | embedded-hal-bus = { version = "0.1.0-rc.2" } | 41 | embedded-hal-bus = { version = "0.1.0-rc.2", features = ["async"] } |
| 55 | num-integer = { version = "0.1.45", default-features = false } | 42 | num-integer = { version = "0.1.45", default-features = false } |
| 56 | microfft = "0.5.0" | 43 | microfft = "0.5.0" |
| 57 | 44 | ||
diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml index 25ae97496..b4d71c751 100644 --- a/examples/nrf5340/Cargo.toml +++ b/examples/nrf5340/Cargo.toml | |||
| @@ -6,37 +6,12 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 9 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = [ | 9 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | "defmt", | 10 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "defmt", "integrated-timers"] } |
| 11 | ] } | 11 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", | 12 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf5340-app-s", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 13 | "nightly", | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 14 | "defmt", | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | "integrated-timers", | ||
| 16 | ] } | ||
| 17 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = [ | ||
| 18 | "defmt", | ||
| 19 | "defmt-timestamp-uptime", | ||
| 20 | ] } | ||
| 21 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = [ | ||
| 22 | "nightly", | ||
| 23 | "unstable-traits", | ||
| 24 | "defmt", | ||
| 25 | "nrf5340-app-s", | ||
| 26 | "time-driver-rtc1", | ||
| 27 | "gpiote", | ||
| 28 | "unstable-pac", | ||
| 29 | ] } | ||
| 30 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = [ | ||
| 31 | "nightly", | ||
| 32 | "defmt", | ||
| 33 | "tcp", | ||
| 34 | "dhcpv4", | ||
| 35 | "medium-ethernet", | ||
| 36 | ] } | ||
| 37 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = [ | ||
| 38 | "defmt", | ||
| 39 | ] } | ||
| 40 | embedded-io-async = { version = "0.6.1" } | 15 | embedded-io-async = { version = "0.6.1" } |
| 41 | 16 | ||
| 42 | defmt = "0.3" | 17 | defmt = "0.3" |
| @@ -46,9 +21,7 @@ static_cell = { version = "2", features = ["nightly"]} | |||
| 46 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 21 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 47 | cortex-m-rt = "0.7.0" | 22 | cortex-m-rt = "0.7.0" |
| 48 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 49 | futures = { version = "0.3.17", default-features = false, features = [ | 24 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 50 | "async-await", | ||
| 51 | ] } | ||
| 52 | rand = { version = "0.8.4", default-features = false } | 25 | rand = { version = "0.8.4", default-features = false } |
| 53 | embedded-storage = "0.3.0" | 26 | embedded-storage = "0.3.0" |
| 54 | usbd-hid = "0.6.0" | 27 | usbd-hid = "0.6.0" |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index e0e0d8a78..08898e96d 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -9,10 +9,10 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } | 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 15 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
| 16 | embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] } | 16 | embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] } |
| 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 18 | embassy-usb-logger = { version = "0.1.0", path = "../../embassy-usb-logger" } | 18 | embassy-usb-logger = { version = "0.1.0", path = "../../embassy-usb-logger" } |
diff --git a/examples/rp/src/bin/pio_uart.rs b/examples/rp/src/bin/pio_uart.rs index fb9d423ec..c0ea23607 100644 --- a/examples/rp/src/bin/pio_uart.rs +++ b/examples/rp/src/bin/pio_uart.rs | |||
| @@ -9,8 +9,7 @@ | |||
| 9 | #![no_std] | 9 | #![no_std] |
| 10 | #![no_main] | 10 | #![no_main] |
| 11 | #![feature(type_alias_impl_trait)] | 11 | #![feature(type_alias_impl_trait)] |
| 12 | #![feature(async_fn_in_trait)] | 12 | #![allow(async_fn_in_trait)] |
| 13 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 14 | 13 | ||
| 15 | use defmt::{info, panic, trace}; | 14 | use defmt::{info, panic, trace}; |
| 16 | use embassy_executor::Spawner; | 15 | use embassy_executor::Spawner; |
| @@ -148,7 +147,7 @@ async fn usb_read<'d, T: Instance + 'd>( | |||
| 148 | let n = usb_rx.read_packet(&mut buf).await?; | 147 | let n = usb_rx.read_packet(&mut buf).await?; |
| 149 | let data = &buf[..n]; | 148 | let data = &buf[..n]; |
| 150 | trace!("USB IN: {:x}", data); | 149 | trace!("USB IN: {:x}", data); |
| 151 | uart_pipe_writer.write(data).await; | 150 | (*uart_pipe_writer).write(data).await; |
| 152 | } | 151 | } |
| 153 | } | 152 | } |
| 154 | 153 | ||
| @@ -159,7 +158,7 @@ async fn usb_write<'d, T: Instance + 'd>( | |||
| 159 | ) -> Result<(), Disconnected> { | 158 | ) -> Result<(), Disconnected> { |
| 160 | let mut buf = [0; 64]; | 159 | let mut buf = [0; 64]; |
| 161 | loop { | 160 | loop { |
| 162 | let n = usb_pipe_reader.read(&mut buf).await; | 161 | let n = (*usb_pipe_reader).read(&mut buf).await; |
| 163 | let data = &buf[..n]; | 162 | let data = &buf[..n]; |
| 164 | trace!("USB OUT: {:x}", data); | 163 | trace!("USB OUT: {:x}", data); |
| 165 | usb_tx.write_packet(&data).await?; | 164 | usb_tx.write_packet(&data).await?; |
| @@ -179,7 +178,7 @@ async fn uart_read( | |||
| 179 | } | 178 | } |
| 180 | let data = &buf[..n]; | 179 | let data = &buf[..n]; |
| 181 | trace!("UART IN: {:x}", buf); | 180 | trace!("UART IN: {:x}", buf); |
| 182 | usb_pipe_writer.write(data).await; | 181 | (*usb_pipe_writer).write(data).await; |
| 183 | } | 182 | } |
| 184 | } | 183 | } |
| 185 | 184 | ||
| @@ -190,7 +189,7 @@ async fn uart_write( | |||
| 190 | ) -> ! { | 189 | ) -> ! { |
| 191 | let mut buf = [0; 64]; | 190 | let mut buf = [0; 64]; |
| 192 | loop { | 191 | loop { |
| 193 | let n = uart_pipe_reader.read(&mut buf).await; | 192 | let n = (*uart_pipe_reader).read(&mut buf).await; |
| 194 | let data = &buf[..n]; | 193 | let data = &buf[..n]; |
| 195 | trace!("UART OUT: {:x}", data); | 194 | trace!("UART OUT: {:x}", data); |
| 196 | let _ = uart_tx.write(&data).await; | 195 | let _ = uart_tx.write(&data).await; |
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index b5344c185..ad1fa6462 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | #![feature(async_fn_in_trait)] | 7 | #![allow(async_fn_in_trait)] |
| 8 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 9 | 8 | ||
| 10 | use core::str::from_utf8; | 9 | use core::str::from_utf8; |
| 11 | 10 | ||
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs index f2acaf3e8..7adf52b88 100644 --- a/examples/rp/src/bin/wifi_scan.rs +++ b/examples/rp/src/bin/wifi_scan.rs | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | #![feature(async_fn_in_trait)] | 7 | #![allow(async_fn_in_trait)] |
| 8 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 9 | 8 | ||
| 10 | use core::str; | 9 | use core::str; |
| 11 | 10 | ||
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 4e74ad117..ec6b4ee74 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | #![feature(async_fn_in_trait)] | 7 | #![allow(async_fn_in_trait)] |
| 8 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 9 | 8 | ||
| 10 | use core::str::from_utf8; | 9 | use core::str::from_utf8; |
| 11 | 10 | ||
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 2a59fd693..228b6aa02 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["log"] } | 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["log"] } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["log", "std", "nightly"] } | 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["log", "std", ] } |
| 11 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } | 11 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } |
| 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } | 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } |
| 13 | embassy-net-ppp = { version = "0.1.0", path = "../../embassy-net-ppp", features = ["log"]} | 13 | embassy-net-ppp = { version = "0.1.0", path = "../../embassy-net-ppp", features = ["log"]} |
| 14 | embedded-io-async = { version = "0.6.1" } | 14 | embedded-io-async = { version = "0.6.1" } |
diff --git a/examples/std/src/bin/net_ppp.rs b/examples/std/src/bin/net_ppp.rs index 6ac31f2f3..cee04e558 100644 --- a/examples/std/src/bin/net_ppp.rs +++ b/examples/std/src/bin/net_ppp.rs | |||
| @@ -8,8 +8,7 @@ | |||
| 8 | //! nc 192.168.7.10 1234 | 8 | //! nc 192.168.7.10 1234 |
| 9 | 9 | ||
| 10 | #![feature(type_alias_impl_trait)] | 10 | #![feature(type_alias_impl_trait)] |
| 11 | #![feature(async_fn_in_trait, impl_trait_projections)] | 11 | #![allow(async_fn_in_trait)] |
| 12 | #![allow(stable_features, unknown_lints, async_fn_in_trait)] | ||
| 13 | 12 | ||
| 14 | #[path = "../serial_port.rs"] | 13 | #[path = "../serial_port.rs"] |
| 15 | mod serial_port; | 14 | mod serial_port; |
diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml index ec5b78b00..595cb76ae 100644 --- a/examples/stm32c0/Cargo.toml +++ b/examples/stm32c0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32c031c6 to your chip name, if necessary. | 8 | # Change stm32c031c6 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index 71b3aaa78..9e85da9cf 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | 8 | ||
| 9 | [dependencies] | 9 | [dependencies] |
| 10 | # Change stm32f091rc to your chip name, if necessary. | 10 | # Change stm32f091rc to your chip name, if necessary. |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f091rc", "time-driver-any", "exti", "unstable-pac"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "memory-x", "stm32f091rc", "time-driver-any", "exti", "unstable-pac"] } |
| 12 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 12 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 13 | cortex-m-rt = "0.7.0" | 13 | cortex-m-rt = "0.7.0" |
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index 29483ec5f..4c9508c20 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f103c8 to your chip name, if necessary. | 8 | # Change stm32f103c8 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any" ] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index f4262e20d..f088f1cb1 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f207zg to your chip name, if necessary. | 8 | # Change stm32f207zg to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index e556b2a4d..ad6b8ef43 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f303ze to your chip name, if necessary. | 8 | # Change stm32f303ze to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32f334/Cargo.toml b/examples/stm32f334/Cargo.toml index e9670ab07..5cdcabfbf 100644 --- a/examples/stm32f334/Cargo.toml +++ b/examples/stm32f334/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 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-futures = { version = "0.1.0", path = "../../embassy-futures" } | 13 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 14 | 14 | ||
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index 8cee6d231..1e85371e3 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -6,12 +6,12 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f429zi to your chip name, if necessary. | 8 | # Change stm32f429zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } |
| 15 | 15 | ||
| 16 | defmt = "0.3" | 16 | defmt = "0.3" |
| 17 | defmt-rtt = "0.4" | 17 | defmt-rtt = "0.4" |
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index 8fe2f2892..e029da2c5 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -6,11 +6,11 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f767zi to your chip name, if necessary. | 8 | # Change stm32f767zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 14 | embedded-io-async = { version = "0.6.1" } | 14 | embedded-io-async = { version = "0.6.1" } |
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 16 | 16 | ||
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index 437f1e754..7218dbd20 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32g071rb to your chip name, if necessary. | 8 | # Change stm32g071rb to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index f5b2ab323..b03c5adb7 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32g491re to your chip name, if necessary. | 8 | # Change stm32g491re to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml index db34005a0..d389463ff 100644 --- a/examples/stm32h5/Cargo.toml +++ b/examples/stm32h5/Cargo.toml | |||
| @@ -6,12 +6,11 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32h563zi to your chip name, if necessary. | 8 | # Change stm32h563zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } |
| 14 | embedded-io-async = { version = "0.6.1" } | ||
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 16 | 15 | ||
| 17 | defmt = "0.3" | 16 | defmt = "0.3" |
| @@ -22,6 +21,7 @@ cortex-m-rt = "0.7.0" | |||
| 22 | embedded-hal = "0.2.6" | 21 | embedded-hal = "0.2.6" |
| 23 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } | 22 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 24 | embedded-hal-async = { version = "=1.0.0-rc.2" } | 23 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 24 | embedded-io-async = { version = "0.6.1" } | ||
| 25 | embedded-nal-async = { version = "0.7.1" } | 25 | embedded-nal-async = { version = "0.7.1" } |
| 26 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 26 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 27 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 27 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index 2fe88dfaf..85396d8cd 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -6,12 +6,11 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32h743bi to your chip name, if necessary. | 8 | # Change stm32h743bi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "unstable-traits", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "chrono"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] } |
| 14 | embedded-io-async = { version = "0.6.1" } | ||
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 16 | 15 | ||
| 17 | defmt = "0.3" | 16 | defmt = "0.3" |
| @@ -23,6 +22,7 @@ embedded-hal = "0.2.6" | |||
| 23 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } | 22 | embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } |
| 24 | embedded-hal-async = { version = "=1.0.0-rc.2" } | 23 | embedded-hal-async = { version = "=1.0.0-rc.2" } |
| 25 | embedded-nal-async = { version = "0.7.1" } | 24 | embedded-nal-async = { version = "0.7.1" } |
| 25 | embedded-io-async = { version = "0.6.1" } | ||
| 26 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 26 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 27 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 27 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 28 | heapless = { version = "0.8", default-features = false } | 28 | heapless = { version = "0.8", default-features = false } |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 15f7afe9c..8ce1e2357 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -6,11 +6,11 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [features] | 7 | [features] |
| 8 | default = ["nightly"] | 8 | default = ["nightly"] |
| 9 | nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstable-traits", "embassy-executor/nightly", "dep:embedded-io-async"] | 9 | nightly = ["embassy-executor/nightly"] |
| 10 | 10 | ||
| 11 | [dependencies] | 11 | [dependencies] |
| 12 | # Change stm32l072cz to your chip name, if necessary. | 12 | # Change stm32l072cz to your chip name, if necessary. |
| 13 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 13 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
| 14 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 14 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 15 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 15 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 16 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 16 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| @@ -20,7 +20,7 @@ defmt-rtt = "0.4" | |||
| 20 | 20 | ||
| 21 | embedded-storage = "0.3.0" | 21 | embedded-storage = "0.3.0" |
| 22 | embedded-io = { version = "0.6.0" } | 22 | embedded-io = { version = "0.6.0" } |
| 23 | embedded-io-async = { version = "0.6.1", optional = true } | 23 | embedded-io-async = { version = "0.6.1" } |
| 24 | 24 | ||
| 25 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 25 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 26 | cortex-m-rt = "0.7.0" | 26 | cortex-m-rt = "0.7.0" |
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index f8f5c776f..94fe339ab 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
| 12 | 12 | ||
| 13 | defmt = "0.3" | 13 | defmt = "0.3" |
| 14 | defmt-rtt = "0.4" | 14 | defmt-rtt = "0.4" |
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index 350e6e260..a0fe457b7 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -6,14 +6,14 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32l4s5vi to your chip name, if necessary. | 8 | # Change stm32l4s5vi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "unstable-traits", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", "unstable-traits", "nightly"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", ] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | embassy-net-adin1110 = { version = "0.2.0", path = "../../embassy-net-adin1110" } | 15 | embassy-net-adin1110 = { version = "0.2.0", path = "../../embassy-net-adin1110" } |
| 16 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "udp", "tcp", "dhcpv4", "medium-ethernet"] } | 16 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "tcp", "dhcpv4", "medium-ethernet"] } |
| 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 18 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } | 18 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } |
| 19 | embedded-io = { version = "0.6.0", features = ["defmt-03"] } | 19 | embedded-io = { version = "0.6.0", features = ["defmt-03"] } |
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index 7bca51ad1..6591e837c 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -6,12 +6,12 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32l552ze to your chip name, if necessary. | 8 | # Change stm32l552ze to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "memory-x"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 15 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 15 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 16 | usbd-hid = "0.6.0" | 16 | usbd-hid = "0.6.0" |
| 17 | 17 | ||
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index 3d316ab3a..28009786f 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32u585ai to your chip name, if necessary. | 8 | # Change stm32u585ai to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 19fdeb6fd..709175119 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -6,12 +6,12 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32wb55rg to your chip name in both dependencies, if necessary. | 8 | # Change stm32wb55rg to your chip name in both dependencies, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } |
| 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } | 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } |
| 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } |
| 15 | 15 | ||
| 16 | defmt = "0.3" | 16 | defmt = "0.3" |
| 17 | defmt-rtt = "0.4" | 17 | defmt-rtt = "0.4" |
diff --git a/examples/stm32wba/Cargo.toml b/examples/stm32wba/Cargo.toml index cac6753c2..e30782c89 100644 --- a/examples/stm32wba/Cargo.toml +++ b/examples/stm32wba/Cargo.toml | |||
| @@ -5,11 +5,11 @@ version = "0.1.0" | |||
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } | 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } |
| 9 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 9 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 10 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 11 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 11 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 12 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true } | 12 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
| 15 | defmt-rtt = "0.4" | 15 | defmt-rtt = "0.4" |
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 4f608fcf1..588721351 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -6,10 +6,10 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32wl55jc-cm4 to your chip name, if necessary. | 8 | # Change stm32wl55jc-cm4 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index c6e95e611..7e4fdff81 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -10,7 +10,7 @@ crate-type = ["cdylib"] | |||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["log"] } | 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["log"] } |
| 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["log", "wasm", "nightly"] } | 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["log", "wasm", ] } |
| 14 | 14 | ||
| 15 | wasm-logger = "0.2.0" | 15 | wasm-logger = "0.2.0" |
| 16 | wasm-bindgen = "0.2" | 16 | wasm-bindgen = "0.2" |
diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml index 70bb17c14..4f9b5a5f2 100644 --- a/tests/nrf/Cargo.toml +++ b/tests/nrf/Cargo.toml | |||
| @@ -8,12 +8,12 @@ license = "MIT OR Apache-2.0" | |||
| 8 | teleprobe-meta = "1" | 8 | teleprobe-meta = "1" |
| 9 | 9 | ||
| 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } | 11 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt", ] } |
| 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "task-arena-size-16384", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "task-arena-size-16384", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits", "defmt-timestamp-uptime"] } | 13 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 14 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nightly", "unstable-traits", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 14 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 15 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } | 15 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } |
| 16 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } | 16 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } |
| 17 | embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] } | 17 | embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] } |
| 18 | embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] } | 18 | embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] } |
| 19 | embedded-hal-async = { version = "1.0.0-rc.2" } | 19 | embedded-hal-async = { version = "1.0.0-rc.2" } |
diff --git a/tests/perf-client/Cargo.toml b/tests/perf-client/Cargo.toml index bab5ac492..6c40d18a1 100644 --- a/tests/perf-client/Cargo.toml +++ b/tests/perf-client/Cargo.toml | |||
| @@ -7,6 +7,6 @@ edition = "2021" | |||
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4"] } | 9 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4"] } |
| 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits"] } | 10 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", ] } |
| 11 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 11 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 12 | defmt = "0.3.0" | 12 | defmt = "0.3.0" |
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index d69bd7952..3c4e6a68b 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml | |||
| @@ -9,10 +9,10 @@ teleprobe-meta = "1.1" | |||
| 9 | 9 | ||
| 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits"] } | 12 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", ] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "time-driver", "critical-section-impl", "intrinsics", "rom-v2-intrinsics", "run-from-ram"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = [ "defmt", "unstable-pac", "time-driver", "critical-section-impl", "intrinsics", "rom-v2-intrinsics", "run-from-ram"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 15 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 15 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
| 16 | embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] } | 16 | embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] } |
| 17 | cyw43 = { path = "../../cyw43", features = ["defmt", "firmware-logs"] } | 17 | cyw43 = { path = "../../cyw43", features = ["defmt", "firmware-logs"] } |
| 18 | cyw43-pio = { path = "../../cyw43-pio", features = ["defmt", "overclock"] } | 18 | cyw43-pio = { path = "../../cyw43-pio", features = ["defmt", "overclock"] } |
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index ba72c6421..cf91a9525 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -51,10 +51,10 @@ teleprobe-meta = "1" | |||
| 51 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } | 51 | embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] } |
| 52 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 52 | embassy-executor = { version = "0.3.3", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 53 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "tick-hz-131_072", "defmt-timestamp-uptime"] } | 53 | embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "tick-hz-131_072", "defmt-timestamp-uptime"] } |
| 54 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } | 54 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "memory-x", "time-driver-any"] } |
| 55 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 55 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 56 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg", "ble"] } | 56 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg", "ble"] } |
| 57 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 57 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
| 58 | perf-client = { path = "../perf-client" } | 58 | perf-client = { path = "../perf-client" } |
| 59 | 59 | ||
| 60 | defmt = "0.3.0" | 60 | defmt = "0.3.0" |
