From 6609a85f3ce941ef07e471e56981a819b17e9303 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Wed, 25 Jun 2025 22:56:11 -0500 Subject: [PATCH] nxp: add feature for lpc55 this is needed since I will be working on adding support for the MCX families to embassy-nxp Co-authored-by: IriniaCh524 --- ci.sh | 2 +- embassy-nxp/Cargo.toml | 10 ++++++++-- examples/lpc55s69/Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ci.sh b/ci.sh index e1fdf998a..036c38d1a 100755 --- a/ci.sh +++ b/ci.sh @@ -176,7 +176,7 @@ cargo batch \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u031r8,defmt,exti,time-driver-any,time \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u073mb,defmt,exti,time-driver-any,time \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u083rc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf \ + --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf --features lpc55,defmt \ --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1104dgs20,defmt,time-driver-any \ --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507pm,defmt,time-driver-any \ --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3519pz,defmt,time-driver-any \ diff --git a/embassy-nxp/Cargo.toml b/embassy-nxp/Cargo.toml index 426af06a0..010607914 100644 --- a/embassy-nxp/Cargo.toml +++ b/embassy-nxp/Cargo.toml @@ -9,12 +9,18 @@ cortex-m-rt = "0.7.0" critical-section = "1.1.2" embassy-hal-internal = { version = "0.2.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] } embassy-sync = { version = "0.7.0", path = "../embassy-sync" } -lpc55-pac = "0.5.0" defmt = { version = "1", optional = true } +## Chip dependencies +lpc55-pac = { version = "0.5.0", optional = true } + [features] default = ["rt"] -rt = ["lpc55-pac/rt"] +# Enable PACs as optional dependencies, since some chip families will use different pac crates. +rt = ["lpc55-pac?/rt"] ## Enable [defmt support](https://docs.rs/defmt) and enables `defmt` debug-log messages and formatting in embassy drivers. defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt"] + +#! ### Chip selection features +lpc55 = ["lpc55-pac"] diff --git a/examples/lpc55s69/Cargo.toml b/examples/lpc55s69/Cargo.toml index 7f81e9c7f..6ec6e51a8 100644 --- a/examples/lpc55s69/Cargo.toml +++ b/examples/lpc55s69/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" [dependencies] -embassy-nxp = { version = "0.1.0", path = "../../embassy-nxp", features = ["rt"] } +embassy-nxp = { version = "0.1.0", path = "../../embassy-nxp", features = ["lpc55", "rt"] } embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt"] } embassy-sync = { version = "0.7.0", path = "../../embassy-sync", features = ["defmt"] } embassy-time = { version = "0.4.0", path = "../../embassy-time", features = ["defmt"] }