From 04949c4abda9b330fb1bf00de08d367649f248ec Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sun, 14 Jul 2024 17:41:17 +0200 Subject: [PATCH] Make `cargo check` work in the top directory --- left/Cargo.toml | 2 +- left/src/main.rs | 5 +++-- right/Cargo.toml | 2 +- right/src/main.rs | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/left/Cargo.toml b/left/Cargo.toml index 1b0cabc..ac17b66 100644 --- a/left/Cargo.toml +++ b/left/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" path = "../lib" package = "tangentbord1-lib" -[dependencies] +[target.thumbv6m-none-eabi.dependencies] cortex-m-rt = "0.7" embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] } embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] } diff --git a/left/src/main.rs b/left/src/main.rs index 738af49..de6f506 100644 --- a/left/src/main.rs +++ b/left/src/main.rs @@ -1,9 +1,10 @@ //! Firmware for Tangentbord1, left half. -#![no_std] +// NOTE: the order of attributes matters here.. #![no_main] +#![cfg(target_os = "none")] // only try to compile this for embedded +#![no_std] #![feature(type_alias_impl_trait)] -#![cfg(target_arch = "arm")] extern crate alloc; extern crate cortex_m_rt; diff --git a/right/Cargo.toml b/right/Cargo.toml index 2c419e3..16afd55 100644 --- a/right/Cargo.toml +++ b/right/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" path = "../lib" package = "tangentbord1-lib" -[dependencies] +[target.thumbv6m-none-eabi.dependencies] cortex-m-rt = "0.7" embassy-rp = { version = "0.1.0", features = ["time-driver", "critical-section-impl"] } embassy-executor = { version = "0.5.0", features = ["nightly", "executor-thread", "integrated-timers", "arch-cortex-m"] } diff --git a/right/src/main.rs b/right/src/main.rs index 99c46a6..8f1262a 100644 --- a/right/src/main.rs +++ b/right/src/main.rs @@ -1,7 +1,9 @@ //! Firmware for Tangentbord1, right half. -#![no_std] +// NOTE: the order of attributes matters here.. #![no_main] +#![cfg(target_os = "none")] // only try to compile this for embedded +#![no_std] #![feature(type_alias_impl_trait)] extern crate alloc;