From 38eb310690ba67aedfbd7a3d20f7700d29894a2e Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 8 Apr 2024 10:25:54 +0200 Subject: [PATCH] boards: add particle-xenon support --- Cargo.lock | 12 ++++++++++++ laze-project.yml | 4 ++++ src/riot-rs-boards/Cargo.toml | 1 + src/riot-rs-boards/particle-xenon/Cargo.toml | 14 ++++++++++++++ src/riot-rs-boards/particle-xenon/src/lib.rs | 8 ++++++++ src/riot-rs-boards/src/lib.rs | 2 ++ 6 files changed, 41 insertions(+) create mode 100644 src/riot-rs-boards/particle-xenon/Cargo.toml create mode 100644 src/riot-rs-boards/particle-xenon/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 3fdc88121..b2c39b56d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2056,6 +2056,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "particle-xenon" +version = "0.1.0" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "nrf52", + "riot-rs-debug", + "riot-rs-rt", +] + [[package]] name = "paste" version = "1.0.14" @@ -2349,6 +2360,7 @@ dependencies = [ "nrf52dk", "nrf5340dk", "nucleo-f401re", + "particle-xenon", "riot-rs-rt", "rpi-pico", ] diff --git a/laze-project.yml b/laze-project.yml index 46bd7f2ed..6a6eae27f 100644 --- a/laze-project.yml +++ b/laze-project.yml @@ -495,6 +495,7 @@ modules: - nrf52840dk - rpi-pico - rpi-pico-w + - particle-xenon env: global: RUSTFLAGS: @@ -590,6 +591,9 @@ builders: - name: microbit-v2 parent: nrf52840 + - name: particle-xenon + parent: nrf52840 + - name: rpi-pico parent: rp2040 env: diff --git a/src/riot-rs-boards/Cargo.toml b/src/riot-rs-boards/Cargo.toml index f337c09c5..f87742775 100644 --- a/src/riot-rs-boards/Cargo.toml +++ b/src/riot-rs-boards/Cargo.toml @@ -24,6 +24,7 @@ nrf52dk = { optional = true, path = "nrf52dk" } nrf5340dk = { optional = true, path = "nrf5340dk" } nucleo-f401re = { optional = true, path = "nucleo-f401re" } rpi-pico = { optional = true, path = "rpi-pico" } +particle-xenon = { optional = true, path = "particle-xenon" } [features] # Allows to have no boards selected, useful to run platform-independent tooling diff --git a/src/riot-rs-boards/particle-xenon/Cargo.toml b/src/riot-rs-boards/particle-xenon/Cargo.toml new file mode 100644 index 000000000..506637203 --- /dev/null +++ b/src/riot-rs-boards/particle-xenon/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "particle-xenon" +version = "0.1.0" +authors = ["Christian Amsüss "] +edition = "2021" + +[dependencies] +cortex-m-rt.workspace = true +cortex-m.workspace = true + +riot-rs-debug.workspace = true +riot-rs-rt.workspace = true + +nrf52 = { path = "../nrf52", features = ["nrf52840"] } diff --git a/src/riot-rs-boards/particle-xenon/src/lib.rs b/src/riot-rs-boards/particle-xenon/src/lib.rs new file mode 100644 index 000000000..fd5894f81 --- /dev/null +++ b/src/riot-rs-boards/particle-xenon/src/lib.rs @@ -0,0 +1,8 @@ +#![no_std] + +use riot_rs_debug::println; + +pub fn init() { + println!("particle_xenon::init()"); + nrf52::init(); +} diff --git a/src/riot-rs-boards/src/lib.rs b/src/riot-rs-boards/src/lib.rs index 5530729fe..ad06a3ecc 100644 --- a/src/riot-rs-boards/src/lib.rs +++ b/src/riot-rs-boards/src/lib.rs @@ -24,6 +24,8 @@ cfg_if! { pub use microbit_v2 as board; } else if #[cfg(feature = "nucleo-f401re")] { pub use nucleo_f401re as board; + } else if #[cfg(feature = "particle-xenon")] { + pub use particle_xenon as board; } else if #[cfg(feature = "rpi-pico")] { pub use rpi_pico as board; } else if #[cfg(feature = "rpi-pico-w")] {