From 316f91ad59c528c00e46198c4a4c4537470e99de Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 17:15:10 +0100 Subject: Switch to new PAC commit --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b4d82bcec..19d1c7174 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ embassy-time = "0.5.0" embassy-time-driver = "0.2.1" embedded-io = "0.6" heapless = "0.8" -mcxa-pac = { git = "https://github.com/OpenDevicePartnership/mcxa-pac", features = ["rt"], rev = "f0281344c605ab24c38979553b41a1655c50625c", version = "0.1.0" } +mcxa-pac = { git = "https://github.com/OpenDevicePartnership/mcxa-pac", features = ["rt"], rev = "3ab4c868f75a9240bb8fdce24982d34f2273aabf", version = "0.1.0" } paste = "1.0.15" embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ -- cgit From 4c62f5fd7ea8061fcbd35e0eab4abd2c83725b37 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 17:19:24 +0100 Subject: Remove Cargo.lock from gitignore, add Cargo.lock --- .gitignore | 1 - Cargo.lock | 597 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 597 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index a23881a76..d128a49cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Rust /target/ -Cargo.lock # IDE .vscode/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..953a71ee0 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,597 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield", + "critical-section", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cortex-m-rt" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +dependencies = [ + "cortex-m-rt-macros", +] + +[[package]] +name = "cortex-m-rt-macros" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" +dependencies = [ + "bitflags", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" +dependencies = [ + "defmt-parser", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror", +] + +[[package]] +name = "defmt-rtt" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d5a25c99d89c40f5676bec8cefe0614f17f0f40e916f98e345dae941807f9e" +dependencies = [ + "critical-section", + "defmt", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "embassy-embedded-hal" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8" +dependencies = [ + "embassy-futures", + "embassy-hal-internal", + "embassy-sync", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b" +dependencies = [ + "cortex-m", + "critical-section", + "document-features", + "embassy-executor-macros", + "embassy-executor-timer-queue", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "embassy-executor-timer-queue" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c" + +[[package]] +name = "embassy-futures" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01" + +[[package]] +name = "embassy-hal-internal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a" +dependencies = [ + "cortex-m", + "critical-section", + "num-traits", +] + +[[package]] +name = "embassy-mcxa276" +version = "0.1.0" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "defmt-rtt", + "embassy-embedded-hal", + "embassy-executor", + "embassy-hal-internal", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "heapless", + "mcxa-pac", + "nb 1.1.0", + "panic-probe", + "paste", +] + +[[package]] +name = "embassy-sync" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-core", + "futures-sink", + "heapless", +] + +[[package]] +name = "embassy-time" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-core", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" +dependencies = [ + "document-features", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "mcxa-pac" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/mcxa-pac?rev=3ab4c868f75a9240bb8fdce24982d34f2273aabf#3ab4c868f75a9240bb8fdce24982d34f2273aabf" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "panic-probe" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" +dependencies = [ + "cortex-m", + "defmt", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] -- cgit From 302702dd58c53a50aa84892eac79a5300c247752 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 17:42:42 +0100 Subject: Tweak CI workflows for embassy-mcxa --- .github/workflows/cargo-vet-pr-comment.yml | 2 +- .github/workflows/check.yml | 13 +++++++++---- .github/workflows/nostd.yml | 11 +++-------- .github/workflows/rolling.yml | 4 ++++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cargo-vet-pr-comment.yml b/.github/workflows/cargo-vet-pr-comment.yml index 4dec76822..fafb21641 100644 --- a/.github/workflows/cargo-vet-pr-comment.yml +++ b/.github/workflows/cargo-vet-pr-comment.yml @@ -134,4 +134,4 @@ jobs: comment-tag: [cargo-vet] --> - edit-mode: replace \ No newline at end of file + edit-mode: replace diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5d4271145..3f116426f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - workdir: [ ".", "examples/rt633", "examples/rt685s-evk",] + workdir: [ ".", "examples",] steps: - uses: actions/checkout@v5 @@ -45,6 +45,7 @@ jobs: uses: dtolnay/rust-toolchain@nightly with: components: rustfmt + targets: thumbv8m.main-none-eabihf - name: cargo fmt --check run: cargo fmt --check @@ -75,6 +76,7 @@ jobs: with: toolchain: ${{ matrix.toolchain }} components: clippy + targets: thumbv8m.main-none-eabihf - name: cargo clippy working-directory: ${{ matrix.workdir }} @@ -110,6 +112,8 @@ jobs: - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + targets: thumbv8m.main-none-eabihf - name: cargo doc run: | @@ -136,9 +140,7 @@ jobs: with: toolchain: stable components: clippy - - - name: rustup target add thumbv8m.main-none-eabihf - run: rustup target add thumbv8m.main-none-eabihf + targets: thumbv8m.main-none-eabihf - name: cargo hack run: cargo hack --feature-powerset check @@ -156,6 +158,8 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + targets: thumbv8m.main-none-eabihf - name: cargo install cargo-deny uses: EmbarkStudios/cargo-deny-action@v2 @@ -199,6 +203,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.msrv }} + targets: thumbv8m.main-none-eabihf - name: cargo +${{ matrix.msrv }} check run: | diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index fbada0516..6083577da 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -20,10 +20,6 @@ jobs: runs-on: ubuntu-latest name: ${{ matrix.target }} - strategy: - matrix: - target: [thumbv8m.main-none-eabihf] - steps: - uses: actions/checkout@v5 with: @@ -31,13 +27,12 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable - - - name: rustup target add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} + with: + targets: thumbv8m.main-none-eabihf - name: Show variable run: echo ${{ env.TOKEN }} - name: cargo check run: | - cargo check --target ${{ matrix.target }} --all-features --locked + cargo check --target thumbv8m.main-none-eabihf --all-features --locked diff --git a/.github/workflows/rolling.yml b/.github/workflows/rolling.yml index 4c9e9718a..386c0df5c 100644 --- a/.github/workflows/rolling.yml +++ b/.github/workflows/rolling.yml @@ -25,6 +25,9 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + targets: thumbv8m.main-none-eabihf + - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack - name: cargo check @@ -62,6 +65,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.msrv }} + targets: thumbv8m.main-none-eabihf - name: cargo +${{ matrix.msrv }} check run: | cargo update -- cgit From 9387d3352a39a903757860568e41890b022c990f Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 13 Nov 2025 08:52:19 -0800 Subject: Install cargo-hack before attempting to use it --- .github/workflows/check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3f116426f..7aec2f489 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -142,6 +142,9 @@ jobs: components: clippy targets: thumbv8m.main-none-eabihf + - name: cargo install cargo-hack + uses: taiki-e/install-action@cargo-hack + - name: cargo hack run: cargo hack --feature-powerset check -- cgit From 357a538e8d5f69c8c0aeacfd416f1ad99b0907d3 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 17:50:11 +0100 Subject: autofix clippy lints --- src/adc.rs | 4 ++-- src/lpuart/buffered.rs | 22 +++++++++++++--------- src/lpuart/mod.rs | 18 +++++++----------- src/ostimer.rs | 6 ++++++ src/rtc.rs | 4 ++-- src/uart.rs | 8 +++++++- 6 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/adc.rs b/src/adc.rs index d456971f7..655bf934f 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -228,7 +228,7 @@ impl Adc { let step = 1.0 / (1u32 << shift) as f32; let tmp = (gain_adjustment / step) as u32; gcra_array[i - 1] = tmp; - gain_adjustment = gain_adjustment - tmp as f32 * step; + gain_adjustment -= tmp as f32 * step; } for i in (1..=17).rev() { @@ -244,7 +244,7 @@ impl Adc { while adc.gcc0().read().rdy().is_gain_cal_not_valid() {} let mut gcca = adc.gcc0().read().gain_cal().bits() as u32; - if gcca & (((0xFFFF >> 0) + 1) >> 1) != 0 { + if gcca & ((0xFFFF + 1) >> 1) != 0 { gcca |= !0xFFFF; } diff --git a/src/lpuart/buffered.rs b/src/lpuart/buffered.rs index 0413fed8e..21b86ada9 100644 --- a/src/lpuart/buffered.rs +++ b/src/lpuart/buffered.rs @@ -24,6 +24,12 @@ pub struct State { initialized: AtomicBool, } +impl Default for State { + fn default() -> Self { + Self::new() + } +} + impl State { /// Create a new state instance pub const fn new() -> Self { @@ -612,16 +618,14 @@ impl crate::interrupt::typelevel::Handler for Buffere } // Handle transmission complete - if ctrl.tcie().is_enabled() { - if regs.stat().read().tc().is_complete() { - state.tx_done.store(true, Ordering::Release); - state.tx_waker.wake(); + if ctrl.tcie().is_enabled() && regs.stat().read().tc().is_complete() { + state.tx_done.store(true, Ordering::Release); + state.tx_waker.wake(); - // Disable TC interrupt - cortex_m::interrupt::free(|_| { - regs.ctrl().modify(|_, w| w.tcie().disabled()); - }); - } + // Disable TC interrupt + cortex_m::interrupt::free(|_| { + regs.ctrl().modify(|_, w| w.tcie().disabled()); + }); } } } diff --git a/src/lpuart/mod.rs b/src/lpuart/mod.rs index bed10bdb0..854136144 100644 --- a/src/lpuart/mod.rs +++ b/src/lpuart/mod.rs @@ -105,8 +105,8 @@ mod gpio { impl GpioPin for super::lib::peripherals::$pin {} - impl Into for super::lib::peripherals::$pin { - fn into(self) -> AnyPin { + impl From for AnyPin { + fn from(val: super::lib::peripherals::$pin) -> Self { AnyPin } } @@ -242,7 +242,7 @@ pub fn configure_baudrate(regs: Regs, baudrate_bps: u32, clock: Clock) -> Result // Configure BAUD register regs.baud().modify(|_, w| unsafe { // Clear and set OSR - w.osr().bits((osr - 1) as u8); + w.osr().bits((osr - 1)); // Clear and set SBR w.sbr().bits(sbr); // Set BOTHEDGE if OSR is between 4 and 7 @@ -305,9 +305,9 @@ pub fn configure_fifo(regs: Regs, config: &Config) { // Configure WATER register for FIFO watermarks regs.water().write(|w| unsafe { w.rxwater() - .bits(config.rx_fifo_watermark as u8) + .bits(config.rx_fifo_watermark) .txwater() - .bits(config.tx_fifo_watermark as u8) + .bits(config.tx_fifo_watermark) }); // Enable TX/RX FIFOs @@ -377,7 +377,7 @@ pub fn calculate_baudrate(baudrate: u32, src_clock_hz: u32) -> Result<(u8, u16)> // Try OSR values from 4 to 32 for osr_temp in 4u8..=32u8 { // Calculate SBR: (srcClock_Hz * 2 / (baudRate * osr) + 1) / 2 - let sbr_calc = ((src_clock_hz * 2) / (baudrate * osr_temp as u32) + 1) / 2; + let sbr_calc = ((src_clock_hz * 2) / (baudrate * osr_temp as u32)).div_ceil(2); let sbr_temp = if sbr_calc == 0 { 1 @@ -390,11 +390,7 @@ pub fn calculate_baudrate(baudrate: u32, src_clock_hz: u32) -> Result<(u8, u16)> // Calculate actual baud rate let calculated_baud = src_clock_hz / (osr_temp as u32 * sbr_temp as u32); - let temp_diff = if calculated_baud > baudrate { - calculated_baud - baudrate - } else { - baudrate - calculated_baud - }; + let temp_diff = calculated_baud.abs_diff(baudrate); if temp_diff <= baud_diff { baud_diff = temp_diff; diff --git a/src/ostimer.rs b/src/ostimer.rs index a4cab6970..8bc68389a 100644 --- a/src/ostimer.rs +++ b/src/ostimer.rs @@ -151,6 +151,12 @@ pub struct Alarm<'d> { _phantom: core::marker::PhantomData<&'d mut ()>, } +impl<'d> Default for Alarm<'d> { + fn default() -> Self { + Self::new() + } +} + impl<'d> Alarm<'d> { /// Create a new alarm instance pub fn new() -> Self { diff --git a/src/rtc.rs b/src/rtc.rs index d62da1f0a..afd46610e 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -102,7 +102,7 @@ pub fn convert_seconds_to_datetime(seconds: u32) -> RtcDateTime { days -= days_in_year; year += 1; - days_in_year = if year % 4 == 0 { + days_in_year = if year.is_multiple_of(4) { DAYS_IN_A_YEAR + 1 } else { DAYS_IN_A_YEAR @@ -110,7 +110,7 @@ pub fn convert_seconds_to_datetime(seconds: u32) -> RtcDateTime { } let mut days_per_month = [0u8, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - if year % 4 == 0 { + if year.is_multiple_of(4) { days_per_month[2] = 29; } diff --git a/src/uart.rs b/src/uart.rs index 3209a318d..cd504a6c6 100644 --- a/src/uart.rs +++ b/src/uart.rs @@ -118,7 +118,7 @@ impl Uart { StopBits::Two => w.sbns().two(), }; // OSR field encodes (osr-1); use raw bits to avoid a long match on all variants - let raw_osr = osr.saturating_sub(1) as u8; + let raw_osr = osr.saturating_sub(1); unsafe { w.osr().bits(raw_osr).sbr().bits(sbr) } }); // 3) CTRL baseline and parity @@ -195,6 +195,12 @@ pub struct RingBuffer { count: usize, } +impl Default for RingBuffer { + fn default() -> Self { + Self::new() + } +} + impl RingBuffer { pub const fn new() -> Self { Self { -- cgit From 306e55819656eeb41c69f2d5625c46419f0534c4 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 18:02:24 +0100 Subject: Manually fix clippy lints --- src/interrupt.rs | 4 ++++ src/lib.rs | 3 +++ src/lpuart/buffered.rs | 1 + src/lpuart/mod.rs | 5 +++-- src/rtc.rs | 25 ++++++++++++++++++------- src/uart.rs | 4 ++++ 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/interrupt.rs b/src/interrupt.rs index 09d7acbef..134ff03fd 100644 --- a/src/interrupt.rs +++ b/src/interrupt.rs @@ -2,6 +2,10 @@ //! Type-level interrupt traits and bindings are provided by the //! `embassy_hal_internal::interrupt_mod!` macro via the generated module below. +// TODO(AJM): As of 2025-11-13, we need to do a pass to ensure safety docs +// are complete prior to release. +#![allow(clippy::missing_safety_doc)] + mod generated { embassy_hal_internal::interrupt_mod!(OS_EVENT, LPUART2, RTC, ADC1); } diff --git a/src/lib.rs b/src/lib.rs index fe27aadba..9899564d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,7 @@ #![no_std] +// TODO(AJM): As of 2025-11-13, we need to do a pass to ensure safety docs +// are complete prior to release. +#![allow(clippy::missing_safety_doc)] pub mod clocks; // still provide clock helpers pub mod gpio; diff --git a/src/lpuart/buffered.rs b/src/lpuart/buffered.rs index 21b86ada9..a617c10a5 100644 --- a/src/lpuart/buffered.rs +++ b/src/lpuart/buffered.rs @@ -110,6 +110,7 @@ impl<'a> BufferedLpuart<'a> { } /// Create a new buffered LPUART with flexible pin configuration + #[allow(clippy::too_many_arguments)] pub fn new_with_pins( _inner: Peri<'a, T>, tx_pin: Option>>, diff --git a/src/lpuart/mod.rs b/src/lpuart/mod.rs index 854136144..35b531421 100644 --- a/src/lpuart/mod.rs +++ b/src/lpuart/mod.rs @@ -106,7 +106,8 @@ mod gpio { impl GpioPin for super::lib::peripherals::$pin {} impl From for AnyPin { - fn from(val: super::lib::peripherals::$pin) -> Self { + // TODO: AJM: any reason we aren't using $pin? + fn from(_val: super::lib::peripherals::$pin) -> Self { AnyPin } } @@ -242,7 +243,7 @@ pub fn configure_baudrate(regs: Regs, baudrate_bps: u32, clock: Clock) -> Result // Configure BAUD register regs.baud().modify(|_, w| unsafe { // Clear and set OSR - w.osr().bits((osr - 1)); + w.osr().bits(osr - 1); // Clear and set SBR w.sbr().bits(sbr); // Set BOTHEDGE if OSR is between 4 and 7 diff --git a/src/rtc.rs b/src/rtc.rs index afd46610e..facb9cf8c 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -109,18 +109,29 @@ pub fn convert_seconds_to_datetime(seconds: u32) -> RtcDateTime { }; } - let mut days_per_month = [0u8, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - if year.is_multiple_of(4) { - days_per_month[2] = 29; - } + let days_per_month = [ + 31, + if year.is_multiple_of(4) { 29 } else { 28 }, + 31, + 30, + 31, + 30, + 31, + 31, + 30, + 31, + 30, + 31, + ]; let mut month = 1; - for m in 1..=12 { - if days <= days_per_month[m] as u32 { + for (m, month_days) in days_per_month.iter().enumerate() { + let m = m + 1; + if days <= *month_days as u32 { month = m; break; } else { - days -= days_per_month[m] as u32; + days -= *month_days as u32; } } diff --git a/src/uart.rs b/src/uart.rs index cd504a6c6..3705959d3 100644 --- a/src/uart.rs +++ b/src/uart.rs @@ -1,6 +1,10 @@ //! Minimal polling UART2 bring-up replicating MCUXpresso hello_world ordering. //! WARNING: This is a narrow implementation only for debug console (115200 8N1). +// TODO(AJM): As of 2025-11-13, we need to do a pass to ensure safety docs +// are complete prior to release. +#![allow(clippy::missing_safety_doc)] + use core::cell::RefCell; use cortex_m::interrupt::Mutex; -- cgit From f1636f3913e06f84ec2a097924bd7154b9bb1a3c Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 13 Nov 2025 18:04:06 +0100 Subject: Bump msrv --- .github/workflows/check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7aec2f489..8e05f5c5d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -180,7 +180,7 @@ jobs: strategy: fail-fast: false matrix: - msrv: ["1.90"] # We're relying on namespaced-features, which + msrv: ["1.91"] # We're relying on namespaced-features, which # was released in 1.60 # # We also depend on `fixed' which requires rust @@ -195,6 +195,8 @@ jobs: # embassy upstream switched to rust 1.85 # # unsigned_is_multiple_of requires 1.90, else we get clippy warnings + # + # mcxa-pac@0.1.0 requires rustc 1.91 name: ubuntu / ${{ matrix.msrv }} steps: -- cgit