From fd1c1635419f8281edda3892f08a91f0e315667a Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Sep 2025 00:32:50 +0200 Subject: ci: add cargo manifest check --- .github/ci/build-nightly.sh | 2 +- .github/ci/build-xtensa.sh | 2 +- .github/ci/build.sh | 2 +- .github/ci/crlf.sh | 17 ----------------- .github/ci/janitor.sh | 15 +++++++++++++++ 5 files changed, 18 insertions(+), 20 deletions(-) delete mode 100755 .github/ci/crlf.sh create mode 100755 .github/ci/janitor.sh diff --git a/.github/ci/build-nightly.sh b/.github/ci/build-nightly.sh index 2d7c4db3f..801d470a1 100755 --- a/.github/ci/build-nightly.sh +++ b/.github/ci/build-nightly.sh @@ -23,7 +23,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 280829ad163f1444999468a57d28fb7c412babbe +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 ./ci-nightly.sh diff --git a/.github/ci/build-xtensa.sh b/.github/ci/build-xtensa.sh index b6626639d..1a97b21b1 100755 --- a/.github/ci/build-xtensa.sh +++ b/.github/ci/build-xtensa.sh @@ -25,7 +25,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 280829ad163f1444999468a57d28fb7c412babbe +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 ./ci-xtensa.sh diff --git a/.github/ci/build.sh b/.github/ci/build.sh index 59bcefed6..72ffa9f1b 100755 --- a/.github/ci/build.sh +++ b/.github/ci/build.sh @@ -28,7 +28,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 280829ad163f1444999468a57d28fb7c412babbe +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 ./ci.sh diff --git a/.github/ci/crlf.sh b/.github/ci/crlf.sh deleted file mode 100755 index 69838ce88..000000000 --- a/.github/ci/crlf.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -## on push branch~=gh-readonly-queue/main/.* -## on pull_request - -set -euo pipefail - -FILES_WITH_CRLF=$(find ! -path "./.git/*" -not -type d | xargs file -N | (grep " CRLF " || true)) - -if [ -z "$FILES_WITH_CRLF" ]; then - echo -e "No files with CRLF endings found." - exit 0 -else - NR_FILES=$(echo "$FILES_WITH_CRLF" | wc -l) - echo -e "ERROR: Found ${NR_FILES} files with CRLF endings." - echo "$FILES_WITH_CRLF" - exit "$NR_FILES" -fi diff --git a/.github/ci/janitor.sh b/.github/ci/janitor.sh new file mode 100755 index 000000000..58ecb8475 --- /dev/null +++ b/.github/ci/janitor.sh @@ -0,0 +1,15 @@ +#!/bin/bash +## on push branch~=gh-readonly-queue/main/.* +## on pull_request + +set -euo pipefail + +export RUSTUP_HOME=/ci/cache/rustup +export CARGO_HOME=/ci/cache/cargo +export CARGO_TARGET_DIR=/ci/cache/target +export PATH=$CARGO_HOME/bin:$PATH + +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 + +cargo embassy-devtool check-crlf +cargo embassy-devtool check-manifest -- cgit From 4d71f432ad05cd8cce50b13cf6de6a1422f3b401 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Sep 2025 00:47:08 +0200 Subject: Update manifests to satisfy new checks. --- cyw43-pio/Cargo.toml | 3 +++ embassy-boot-nrf/Cargo.toml | 3 ++- embassy-boot/Cargo.toml | 2 ++ embassy-embedded-hal/Cargo.toml | 1 + embassy-executor/Cargo.toml | 6 ++++++ embassy-futures/Cargo.toml | 4 ++++ embassy-hal-internal/Cargo.toml | 3 +++ embassy-imxrt/Cargo.toml | 2 +- embassy-net-driver-channel/Cargo.toml | 4 ++++ embassy-net-driver/Cargo.toml | 3 +++ embassy-net-enc28j60/Cargo.toml | 4 ++++ embassy-net-wiznet/Cargo.toml | 3 +++ embassy-net/Cargo.toml | 2 ++ embassy-nrf/Cargo.toml | 2 ++ embassy-nxp/Cargo.toml | 1 + embassy-rp/Cargo.toml | 4 ++++ embassy-stm32/Cargo.toml | 4 ++++ embassy-sync/Cargo.toml | 2 ++ embassy-time/Cargo.toml | 5 +++++ embassy-usb-dfu/Cargo.toml | 3 +++ embassy-usb-driver/Cargo.toml | 3 +++ embassy-usb-synopsys-otg/Cargo.toml | 4 ++++ embassy-usb/Cargo.toml | 1 + examples/mimxrt1011/Cargo.toml | 2 +- examples/mimxrt1062-evk/Cargo.toml | 2 +- examples/mimxrt6/Cargo.toml | 2 +- tests/perf-client/Cargo.toml | 1 + tests/perf-server/Cargo.toml | 1 + tests/utils/Cargo.toml | 1 + 29 files changed, 73 insertions(+), 5 deletions(-) diff --git a/cyw43-pio/Cargo.toml b/cyw43-pio/Cargo.toml index 40dd02f61..6ab5c453e 100644 --- a/cyw43-pio/Cargo.toml +++ b/cyw43-pio/Cargo.toml @@ -15,6 +15,9 @@ embassy-rp = { version = "0.8.0", path = "../embassy-rp" } fixed = "1.23.1" defmt = { version = "1.0.1", optional = true } +[features] +defmt = ["dep:defmt"] + [package.metadata.embassy] build = [ {target = "thumbv6m-none-eabi", features = ["embassy-rp/rp2040"]}, diff --git a/embassy-boot-nrf/Cargo.toml b/embassy-boot-nrf/Cargo.toml index 3b631ef0c..49dff061a 100644 --- a/embassy-boot-nrf/Cargo.toml +++ b/embassy-boot-nrf/Cargo.toml @@ -52,6 +52,7 @@ defmt = [ "embassy-boot/defmt", "embassy-nrf/defmt", ] +log = ["dep:log"] softdevice = [ - "nrf-softdevice-mbr", + "dep:nrf-softdevice-mbr", ] diff --git a/embassy-boot/Cargo.toml b/embassy-boot/Cargo.toml index ed0242c13..a18438c81 100644 --- a/embassy-boot/Cargo.toml +++ b/embassy-boot/Cargo.toml @@ -45,6 +45,8 @@ critical-section = { version = "1.1.1", features = ["std"] } ed25519-dalek = { version = "2", default-features = false, features = ["std", "rand_core", "digest"] } [features] +defmt = ["dep:defmt"] +log = ["dep:log"] ed25519-dalek = ["dep:ed25519-dalek", "_verify"] ed25519-salty = ["dep:salty", "_verify"] flash-erase-zero = [] diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index a66e01717..8b8122567 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml @@ -25,6 +25,7 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-embed target = "x86_64-unknown-linux-gnu" [features] +defmt = ["dep:defmt"] time = ["dep:embassy-time"] [dependencies] diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index f6dce5c0e..61d060630 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml @@ -123,6 +123,12 @@ rustversion = "1.0.21" ## Enable nightly-only features nightly = ["embassy-executor-macros/nightly"] +## Enable defmt logging +defmt = ["dep:defmt"] + +## Enable log logging +log = ["dep:log"] + # Enables turbo wakers, which requires patching core. Not surfaced in the docs by default due to # being an complicated advanced and undocumented feature. # See: https://github.com/embassy-rs/embassy/pull/1263 diff --git a/embassy-futures/Cargo.toml b/embassy-futures/Cargo.toml index 2d62b28e5..07d5219cf 100644 --- a/embassy-futures/Cargo.toml +++ b/embassy-futures/Cargo.toml @@ -26,3 +26,7 @@ features = ["defmt"] [dependencies] defmt = { version = "1.0.1", optional = true } log = { version = "0.4.14", optional = true } + +[features] +defmt = ["dep:defmt"] +log = ["dep:log"] diff --git a/embassy-hal-internal/Cargo.toml b/embassy-hal-internal/Cargo.toml index b4c52ccfa..11dcc2466 100644 --- a/embassy-hal-internal/Cargo.toml +++ b/embassy-hal-internal/Cargo.toml @@ -14,6 +14,9 @@ categories = [ [features] +defmt = ["dep:defmt"] +log = ["dep:log"] + # Define the number of NVIC priority bits. prio-bits-0 = [] prio-bits-1 = [] diff --git a/embassy-imxrt/Cargo.toml b/embassy-imxrt/Cargo.toml index 8a9c1252e..7561640dd 100644 --- a/embassy-imxrt/Cargo.toml +++ b/embassy-imxrt/Cargo.toml @@ -2,7 +2,7 @@ name = "embassy-imxrt" version = "0.1.0" edition = "2021" -license = "MIT" +license = "MIT OR Apache-2.0" description = "Embassy Hardware Abstraction Layer (HAL) for the IMXRT microcontroller" keywords = ["embedded", "async", "imxrt", "rt600", "embedded-hal"] categories = ["embedded", "hardware-support", "no-std", "asynchronous"] diff --git a/embassy-net-driver-channel/Cargo.toml b/embassy-net-driver-channel/Cargo.toml index cf498c59f..1e40c2d87 100644 --- a/embassy-net-driver-channel/Cargo.toml +++ b/embassy-net-driver-channel/Cargo.toml @@ -28,3 +28,7 @@ log = { version = "0.4.14", optional = true } embassy-sync = { version = "0.7.2", path = "../embassy-sync" } embassy-futures = { version = "0.1.2", path = "../embassy-futures" } embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" } + +[features] +defmt = ["dep:defmt"] +log = ["dep:log"] diff --git a/embassy-net-driver/Cargo.toml b/embassy-net-driver/Cargo.toml index 34bc6c91a..a36e412ad 100644 --- a/embassy-net-driver/Cargo.toml +++ b/embassy-net-driver/Cargo.toml @@ -23,3 +23,6 @@ features = ["defmt"] [dependencies] defmt = { version = "1.0.1", optional = true } + +[features] +defmt = ["dep:defmt"] diff --git a/embassy-net-enc28j60/Cargo.toml b/embassy-net-enc28j60/Cargo.toml index a3e3285a3..e7bad118b 100644 --- a/embassy-net-enc28j60/Cargo.toml +++ b/embassy-net-enc28j60/Cargo.toml @@ -19,6 +19,10 @@ embassy-futures = { version = "0.1.2", path = "../embassy-futures" } defmt = { version = "1.0.1", optional = true } log = { version = "0.4.14", optional = true } +[features] +defmt = ["dep:defmt", "embassy-net-driver/defmt"] +log = ["dep:log"] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-enc28j60-v$VERSION/embassy-net-enc28j60/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-enc28j60/src/" diff --git a/embassy-net-wiznet/Cargo.toml b/embassy-net-wiznet/Cargo.toml index 36c349df1..6e6dccebd 100644 --- a/embassy-net-wiznet/Cargo.toml +++ b/embassy-net-wiznet/Cargo.toml @@ -17,6 +17,9 @@ embassy-time = { version = "0.5.0", path = "../embassy-time" } embassy-futures = { version = "0.1.2", path = "../embassy-futures" } defmt = { version = "1.0.1", optional = true } +[features] +defmt = ["dep:defmt", "embassy-net-driver-channel/defmt"] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-wiznet-v$VERSION/embassy-net-wiznet/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-wiznet/src/" diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index 61a2c858a..31ce7e9a6 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml @@ -53,6 +53,8 @@ features = ["defmt", "tcp", "udp", "raw", "dns", "icmp", "dhcpv4", "proto-ipv6", [features] ## Enable defmt defmt = ["dep:defmt", "smoltcp/defmt", "embassy-net-driver/defmt", "embassy-time/defmt", "heapless/defmt-03", "defmt?/ip_in_core"] +## Enable log +log = ["dep:log"] ## Trace all raw received and transmitted packets using defmt or log. packet-trace = [] diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 4afd28fbd..1af633500 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml @@ -66,6 +66,8 @@ time = ["dep:embassy-time", "embassy-embedded-hal/time"] ## Enable defmt defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver/defmt", "embassy-embedded-hal/defmt"] +## Enable log +log = ["dep:log"] ## Reexport the PAC for the currently enabled chip at `embassy_nrf::pac` (unstable) unstable-pac = [] diff --git a/embassy-nxp/Cargo.toml b/embassy-nxp/Cargo.toml index 455915f29..073fdabe4 100644 --- a/embassy-nxp/Cargo.toml +++ b/embassy-nxp/Cargo.toml @@ -2,6 +2,7 @@ name = "embassy-nxp" version = "0.1.0" edition = "2021" +license = "MIT OR Apache-2.0" publish = false diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 101914a36..f6b0900f2 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml @@ -45,6 +45,10 @@ rt = [ "rp-pac/rt" ] ## Enable [defmt support](https://docs.rs/defmt) and enables `defmt` debug-log messages and formatting in embassy drivers. defmt = ["dep:defmt", "embassy-usb-driver/defmt", "embassy-hal-internal/defmt"] +## Enable log support +log = ["dep:log"] +## Enable chrono support +chrono = ["dep:chrono"] ## Configure the [`critical-section`](https://docs.rs/critical-section) crate to use an implementation that is safe for multicore use on rp2040. critical-section-impl = ["critical-section/restore-state-u8"] diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 6cd8ed262..369fabc50 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -225,6 +225,10 @@ defmt = [ "embassy-usb-synopsys-otg/defmt", "stm32-metapac/defmt" ] +## Use log for logging +log = ["dep:log"] +## Enable chrono support +chrono = ["dep:chrono"] exti = [] low-power = [ "dep:embassy-executor", "embassy-executor?/arch-cortex-m", "time" ] diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml index 6494da727..64d76baba 100644 --- a/embassy-sync/Cargo.toml +++ b/embassy-sync/Cargo.toml @@ -27,6 +27,8 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/ target = "thumbv7em-none-eabi" [features] +defmt = ["dep:defmt"] +log = ["dep:log"] std = [] turbowakers = [] diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 2d7c3c1fa..bad6ecf97 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml @@ -31,6 +31,11 @@ target = "x86_64-unknown-linux-gnu" features = ["defmt", "std"] [features] +## Enable defmt +defmt = ["dep:defmt"] +## Enable log +log = ["dep:log"] + ## Display the time since startup next to defmt log messages. ## At most 1 `defmt-timestamp-uptime-*` feature can be used. ## `defmt-timestamp-uptime` is provided for backwards compatibility (provides the same format as `uptime-us`). diff --git a/embassy-usb-dfu/Cargo.toml b/embassy-usb-dfu/Cargo.toml index 4a65c6895..e70ab970e 100644 --- a/embassy-usb-dfu/Cargo.toml +++ b/embassy-usb-dfu/Cargo.toml @@ -49,6 +49,9 @@ esp32c3-hal = { version = "0.13.0", optional = true, default-features = false } dfu = [] application = [] defmt = ["dep:defmt", "embassy-boot/defmt", "embassy-usb/defmt"] +log = ["dep:log"] +cortex-m = ["dep:cortex-m"] +esp32c3-hal = ["dep:esp32c3-hal"] ed25519-dalek = ["embassy-boot/ed25519-dalek", "_verify"] ed25519-salty = ["embassy-boot/ed25519-salty", "_verify"] diff --git a/embassy-usb-driver/Cargo.toml b/embassy-usb-driver/Cargo.toml index de69bf694..6e4c31273 100644 --- a/embassy-usb-driver/Cargo.toml +++ b/embassy-usb-driver/Cargo.toml @@ -21,3 +21,6 @@ features = ["defmt"] [dependencies] embedded-io-async = "0.6.1" defmt = { version = "1", optional = true } + +[features] +defmt = ["dep:defmt"] diff --git a/embassy-usb-synopsys-otg/Cargo.toml b/embassy-usb-synopsys-otg/Cargo.toml index ec518ac93..61b14a215 100644 --- a/embassy-usb-synopsys-otg/Cargo.toml +++ b/embassy-usb-synopsys-otg/Cargo.toml @@ -23,3 +23,7 @@ embassy-usb-driver = { version = "0.2.0", path = "../embassy-usb-driver" } defmt = { version = "1.0.1", optional = true } log = { version = "0.4.14", optional = true } + +[features] +defmt = ["dep:defmt", "embassy-usb-driver/defmt"] +log = ["dep:log"] diff --git a/embassy-usb/Cargo.toml b/embassy-usb/Cargo.toml index e309eec93..bff48c4a6 100644 --- a/embassy-usb/Cargo.toml +++ b/embassy-usb/Cargo.toml @@ -31,6 +31,7 @@ features = ["defmt", "usbd-hid"] [features] defmt = ["dep:defmt", "embassy-usb-driver/defmt"] +log = ["dep:log"] usbd-hid = ["dep:usbd-hid", "dep:ssmarshal"] default = ["usbd-hid"] diff --git a/examples/mimxrt1011/Cargo.toml b/examples/mimxrt1011/Cargo.toml index 488f3167b..3038f5d4d 100644 --- a/examples/mimxrt1011/Cargo.toml +++ b/examples/mimxrt1011/Cargo.toml @@ -2,7 +2,7 @@ name = "embassy-imxrt1011-examples" version = "0.1.0" edition = "2021" -license = "MIT or Apache-2.0" +license = "MIT OR Apache-2.0" publish = false [dependencies] diff --git a/examples/mimxrt1062-evk/Cargo.toml b/examples/mimxrt1062-evk/Cargo.toml index ec6c5c872..82a24490d 100644 --- a/examples/mimxrt1062-evk/Cargo.toml +++ b/examples/mimxrt1062-evk/Cargo.toml @@ -2,7 +2,7 @@ name = "embassy-imxrt1062-evk-examples" version = "0.1.0" edition = "2021" -license = "MIT or Apache-2.0" +license = "MIT OR Apache-2.0" publish = false [dependencies] diff --git a/examples/mimxrt6/Cargo.toml b/examples/mimxrt6/Cargo.toml index 28de9d273..3f7ad8485 100644 --- a/examples/mimxrt6/Cargo.toml +++ b/examples/mimxrt6/Cargo.toml @@ -2,7 +2,7 @@ name = "embassy-imxrt-examples" version = "0.1.0" edition = "2021" -license = "MIT or Apache-2.0" +license = "MIT OR Apache-2.0" publish = false [dependencies] diff --git a/tests/perf-client/Cargo.toml b/tests/perf-client/Cargo.toml index 581b60d6f..c426fdd74 100644 --- a/tests/perf-client/Cargo.toml +++ b/tests/perf-client/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-client" version = "0.1.0" edition = "2021" +license = "MIT OR Apache-2.0" publish = false [dependencies] diff --git a/tests/perf-server/Cargo.toml b/tests/perf-server/Cargo.toml index 22614a33a..f048eade2 100644 --- a/tests/perf-server/Cargo.toml +++ b/tests/perf-server/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-server" version = "0.1.0" edition = "2021" +license = "MIT OR Apache-2.0" publish = false [dependencies] diff --git a/tests/utils/Cargo.toml b/tests/utils/Cargo.toml index f76feaa20..ddb990e0f 100644 --- a/tests/utils/Cargo.toml +++ b/tests/utils/Cargo.toml @@ -2,6 +2,7 @@ name = "test-utils" version = "0.1.0" edition = "2021" +license = "MIT OR Apache-2.0" publish = false [dependencies] -- cgit From 27df9288f343c2855d1daec00d127541826d664f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Sep 2025 00:56:14 +0200 Subject: aaaaaa --- .github/ci/build-nightly.sh | 2 +- .github/ci/build-xtensa.sh | 2 +- .github/ci/build.sh | 2 +- .github/ci/janitor.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ci/build-nightly.sh b/.github/ci/build-nightly.sh index 801d470a1..257d7ebd3 100755 --- a/.github/ci/build-nightly.sh +++ b/.github/ci/build-nightly.sh @@ -23,7 +23,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 3ca80f7065acbe0b69b7da463fab60e744f9de79 ./ci-nightly.sh diff --git a/.github/ci/build-xtensa.sh b/.github/ci/build-xtensa.sh index 1a97b21b1..339e28467 100755 --- a/.github/ci/build-xtensa.sh +++ b/.github/ci/build-xtensa.sh @@ -25,7 +25,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 3ca80f7065acbe0b69b7da463fab60e744f9de79 ./ci-xtensa.sh diff --git a/.github/ci/build.sh b/.github/ci/build.sh index 72ffa9f1b..d7201aedb 100755 --- a/.github/ci/build.sh +++ b/.github/ci/build.sh @@ -28,7 +28,7 @@ fi hashtime restore /ci/cache/filetime.json || true hashtime save /ci/cache/filetime.json -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 3ca80f7065acbe0b69b7da463fab60e744f9de79 ./ci.sh diff --git a/.github/ci/janitor.sh b/.github/ci/janitor.sh index 58ecb8475..bd04f47fc 100755 --- a/.github/ci/janitor.sh +++ b/.github/ci/janitor.sh @@ -9,7 +9,7 @@ export CARGO_HOME=/ci/cache/cargo export CARGO_TARGET_DIR=/ci/cache/target export PATH=$CARGO_HOME/bin:$PATH -cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 2357881abb81a0a3672ff992e199963f9f63bb10 +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 3ca80f7065acbe0b69b7da463fab60e744f9de79 cargo embassy-devtool check-crlf cargo embassy-devtool check-manifest -- cgit From 54a95927f054dd7229fd5e26c3acee509f71c82f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Sep 2025 00:56:34 +0200 Subject: ci: use devtool to build docs. --- .github/ci/doc.sh | 54 +++--------------------------------------------------- 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/.github/ci/doc.sh b/.github/ci/doc.sh index 876c261a1..70ce110d1 100755 --- a/.github/ci/doc.sh +++ b/.github/ci/doc.sh @@ -9,62 +9,14 @@ set -euxo pipefail export RUSTUP_HOME=/ci/cache/rustup export CARGO_HOME=/ci/cache/cargo export CARGO_TARGET_DIR=/ci/cache/target -export BUILDER_THREADS=4 -export BUILDER_COMPRESS=true +export PATH=$CARGO_HOME/bin:$PATH mv rust-toolchain-nightly.toml rust-toolchain.toml -# force rustup to download the toolchain before starting building. -# Otherwise, the docs builder is running multiple instances of cargo rustdoc concurrently. -# They all see the toolchain is not installed and try to install it in parallel -# which makes rustup very sad -rustc --version > /dev/null +cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --locked --rev 3ca80f7065acbe0b69b7da463fab60e744f9de79 -docserver build -i ./embassy-boot -o webroot/crates/embassy-boot/git.zup -docserver build -i ./embassy-boot-nrf -o webroot/crates/embassy-boot-nrf/git.zup -docserver build -i ./embassy-boot-rp -o webroot/crates/embassy-boot-rp/git.zup -docserver build -i ./embassy-boot-stm32 -o webroot/crates/embassy-boot-stm32/git.zup -docserver build -i ./embassy-embedded-hal -o webroot/crates/embassy-embedded-hal/git.zup -docserver build -i ./embassy-executor -o webroot/crates/embassy-executor/git.zup -docserver build -i ./embassy-futures -o webroot/crates/embassy-futures/git.zup -docserver build -i ./embassy-nrf -o webroot/crates/embassy-nrf/git.zup -docserver build -i ./embassy-rp -o webroot/crates/embassy-rp/git.zup -docserver build -i ./embassy-mspm0 -o webroot/crates/embassy-mspm0/git.zup -docserver build -i ./embassy-nxp -o webroot/crates/embassy-nxp/git.zup -docserver build -i ./embassy-sync -o webroot/crates/embassy-sync/git.zup -docserver build -i ./cyw43 -o webroot/crates/cyw43/git.zup -docserver build -i ./cyw43-pio -o webroot/crates/cyw43-pio/git.zup -docserver build -i ./embassy-stm32-wpan -o webroot/crates/embassy-stm32-wpan/git.zup --output-static webroot/static - -docserver build -i ./embassy-time -o webroot/crates/embassy-time/git.zup -docserver build -i ./embassy-time-driver -o webroot/crates/embassy-time-driver/git.zup -docserver build -i ./embassy-time-queue-utils -o webroot/crates/embassy-time-queue-utils/git.zup - -docserver build -i ./embassy-usb -o webroot/crates/embassy-usb/git.zup -docserver build -i ./embassy-usb-dfu -o webroot/crates/embassy-usb-dfu/git.zup -docserver build -i ./embassy-usb-driver -o webroot/crates/embassy-usb-driver/git.zup -docserver build -i ./embassy-usb-logger -o webroot/crates/embassy-usb-logger/git.zup -docserver build -i ./embassy-usb-synopsys-otg -o webroot/crates/embassy-usb-synopsys-otg/git.zup - -docserver build -i ./embassy-net -o webroot/crates/embassy-net/git.zup -docserver build -i ./embassy-net-nrf91 -o webroot/crates/embassy-net-nrf91/git.zup -docserver build -i ./embassy-net-driver -o webroot/crates/embassy-net-driver/git.zup -docserver build -i ./embassy-net-driver-channel -o webroot/crates/embassy-net-driver-channel/git.zup -docserver build -i ./embassy-net-wiznet -o webroot/crates/embassy-net-wiznet/git.zup -docserver build -i ./embassy-net-ppp -o webroot/crates/embassy-net-ppp/git.zup -docserver build -i ./embassy-net-tuntap -o webroot/crates/embassy-net-tuntap/git.zup -docserver build -i ./embassy-net-enc28j60 -o webroot/crates/embassy-net-enc28j60/git.zup -docserver build -i ./embassy-net-esp-hosted -o webroot/crates/embassy-net-esp-hosted/git.zup -docserver build -i ./embassy-net-adin1110 -o webroot/crates/embassy-net-adin1110/git.zup +cargo embassy-devtool doc -o webroot export KUBECONFIG=/ci/secrets/kubeconfig.yml POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name}) kubectl cp webroot/crates $POD:/data kubectl cp webroot/static $POD:/data - -# build and upload stm32 last -# so that it doesn't prevent other crates from getting docs updates when it breaks. - -rm -rf webroot -docserver build -i ./embassy-stm32 -o webroot/crates/embassy-stm32/git.zup -POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name}) -kubectl cp webroot/crates $POD:/data -- cgit From 0850f3b537feb66160b721c280d07d7c85518151 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Sep 2025 01:00:38 +0200 Subject: Update Rust. --- embassy-executor/tests/ui/spawn_nonsend.stderr | 6 +++--- embassy-executor/tests/ui/unsafe_op_in_unsafe_task.stderr | 2 +- embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr | 8 ++++---- rust-toolchain-nightly.toml | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/embassy-executor/tests/ui/spawn_nonsend.stderr b/embassy-executor/tests/ui/spawn_nonsend.stderr index 25bd7d78d..5a3131602 100644 --- a/embassy-executor/tests/ui/spawn_nonsend.stderr +++ b/embassy-executor/tests/ui/spawn_nonsend.stderr @@ -9,7 +9,7 @@ warning: unused import: `core::future::Future` error[E0277]: `*mut ()` cannot be sent between threads safely --> tests/ui/spawn_nonsend.rs:13:13 | -7 | #[embassy_executor::task] + 7 | #[embassy_executor::task] | ------------------------- within this `impl Sized` ... 13 | s.spawn(task(core::ptr::null_mut()).unwrap()); @@ -21,7 +21,7 @@ error[E0277]: `*mut ()` cannot be sent between threads safely note: required because it's used within this closure --> tests/ui/spawn_nonsend.rs:7:1 | -7 | #[embassy_executor::task] + 7 | #[embassy_executor::task] | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: required because it appears within the type `impl Sized` --> src/raw/mod.rs @@ -31,7 +31,7 @@ note: required because it appears within the type `impl Sized` note: required because it appears within the type `impl Sized` --> tests/ui/spawn_nonsend.rs:7:1 | -7 | #[embassy_executor::task] + 7 | #[embassy_executor::task] | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `SendSpawner::spawn` --> src/spawner.rs diff --git a/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.stderr b/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.stderr index d987a4b95..033395584 100644 --- a/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.stderr +++ b/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `std::ptr::const_ptr::::rea 7 | (&x as *const i32).read(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | - = note: for more information, see + = note: for more information, see = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> tests/ui/unsafe_op_in_unsafe_task.rs:5:1 diff --git a/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr b/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr index daf79ad28..417fb8e31 100644 --- a/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr +++ b/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr @@ -1,10 +1,10 @@ error[E0277]: `*const u8` cannot be shared between threads safely --> tests/ui/sync_impl/lazy_lock_function.rs:8:16 | -6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; + 6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; | -- within this `{closure@$DIR/tests/ui/sync_impl/lazy_lock_function.rs:6:47: 6:49}` -7 | -8 | check_sync(LazyLock::new(closure_capturing_non_sync_variable)); + 7 | + 8 | check_sync(LazyLock::new(closure_capturing_non_sync_variable)); | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely | | | required by a bound introduced by this call @@ -14,7 +14,7 @@ error[E0277]: `*const u8` cannot be shared between threads safely note: required because it's used within this closure --> tests/ui/sync_impl/lazy_lock_function.rs:6:47 | -6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; + 6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; | ^^ = note: required for `embassy_sync::lazy_lock::LazyLock` to implement `Sync` note: required by a bound in `check_sync` diff --git a/rust-toolchain-nightly.toml b/rust-toolchain-nightly.toml index 411cc6946..d3e88c7e1 100644 --- a/rust-toolchain-nightly.toml +++ b/rust-toolchain-nightly.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2025-06-29" +channel = "nightly-2025-08-05" components = [ "rust-src", "rustfmt", "llvm-tools", "miri" ] targets = [ "thumbv7em-none-eabi", diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e24864037..5d925c934 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.88" +channel = "1.90" components = [ "rust-src", "rustfmt", "llvm-tools" ] targets = [ "thumbv7em-none-eabi", -- cgit From c692a97b654adc50f997852a360ce3277cb73db4 Mon Sep 17 00:00:00 2001 From: Matthew Tran <0e4ef622@gmail.com> Date: Sun, 21 Sep 2025 23:01:03 -0500 Subject: nrf: impl Drop for Timer --- embassy-nrf/src/timer.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index de2875765..b6a77bd2e 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs @@ -104,7 +104,7 @@ impl<'d, T: Instance> Timer<'d, T> { Self::new_inner(timer, true) } - fn new_inner(timer: Peri<'d, T>, _is_counter: bool) -> Self { + fn new_inner(timer: Peri<'d, T>, is_counter: bool) -> Self { let regs = T::regs(); let this = Self { _p: timer }; @@ -114,7 +114,7 @@ impl<'d, T: Instance> Timer<'d, T> { this.stop(); regs.mode().write(|w| { - w.set_mode(match _is_counter { + w.set_mode(match is_counter { #[cfg(not(feature = "_nrf51"))] true => vals::Mode::LOW_POWER_COUNTER, #[cfg(feature = "_nrf51")] @@ -218,6 +218,12 @@ impl<'d, T: Instance> Timer<'d, T> { } } +impl<'d, T: Instance> Drop for Timer<'d, T> { + fn drop(&mut self) { + self.stop(); + } +} + /// A representation of a timer's Capture/Compare (CC) register. /// /// A CC register holds a 32-bit value. -- cgit From d463a57879c0e02c188f63ab99c40d6ab91ea54e Mon Sep 17 00:00:00 2001 From: Matthew Tran <0e4ef622@gmail.com> Date: Sun, 21 Sep 2025 23:01:11 -0500 Subject: nrf: add persist() method for gpiote and timer --- embassy-nrf/src/gpiote.rs | 18 ++++++++++++++++++ embassy-nrf/src/timer.rs | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index d169b49f9..43e43f0bf 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs @@ -193,6 +193,15 @@ pub struct InputChannel<'d> { pin: Input<'d>, } +impl InputChannel<'static> { + /// Persist the channel's configuration for the rest of the program's lifetime. This method + /// should be preferred over [`core::mem::forget()`] because the `'static` bound prevents + /// accidental reuse of the underlying peripheral. + pub fn persist(self) { + core::mem::forget(self); + } +} + impl<'d> Drop for InputChannel<'d> { fn drop(&mut self) { let g = regs(); @@ -263,6 +272,15 @@ pub struct OutputChannel<'d> { _pin: Output<'d>, } +impl OutputChannel<'static> { + /// Persist the channel's configuration for the rest of the program's lifetime. This method + /// should be preferred over [`core::mem::forget()`] because the `'static` bound prevents + /// accidental reuse of the underlying peripheral. + pub fn persist(self) { + core::mem::forget(self); + } +} + impl<'d> Drop for OutputChannel<'d> { fn drop(&mut self) { let g = regs(); diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index b6a77bd2e..5d6afe49b 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs @@ -218,6 +218,15 @@ impl<'d, T: Instance> Timer<'d, T> { } } +impl Timer<'static, T> { + /// Persist the timer's configuration for the rest of the program's lifetime. This method + /// should be preferred over [`core::mem::forget()`] because the `'static` bound prevents + /// accidental reuse of the underlying peripheral. + pub fn persist(self) { + core::mem::forget(self); + } +} + impl<'d, T: Instance> Drop for Timer<'d, T> { fn drop(&mut self) { self.stop(); -- cgit From 99f7e150c56b09a968e05f98b9f924f17c43296e Mon Sep 17 00:00:00 2001 From: Matthew Tran <0e4ef622@gmail.com> Date: Sun, 21 Sep 2025 23:04:03 -0500 Subject: nrf: Update changelog --- embassy-nrf/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embassy-nrf/CHANGELOG.md b/embassy-nrf/CHANGELOG.md index de8dfd391..0cc1d56bb 100644 --- a/embassy-nrf/CHANGELOG.md +++ b/embassy-nrf/CHANGELOG.md @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - changed: nrf54l: Disable glitch detection and enable DC/DC in init. - changed: Add embassy-net-driver-channel implementation for IEEE 802.15.4 -- changed: add persist() method for gpio and ppi +- changed: add persist() method for gpio, gpiote, timer and ppi +- changed: impl Drop for Timer ## 0.7.0 - 2025-08-26 -- cgit