From 60fe87d66e163d376789910467cc6e8441c802b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas=20Rodr=C3=ADguez?= Date: Thu, 7 Mar 2024 13:05:07 +0100 Subject: [PATCH] Review --- examples/hifive1/Cargo.toml | 1 - examples/hifive1/examples/prio_inheritance.rs | 1 - examples/hifive1/examples/static.rs | 1 - examples/hifive1/examples/task.rs | 1 - examples/hifive1/examples/zero_prio_task.rs | 1 - rtic-macros/CHANGELOG.md | 2 +- .../src/codegen/bindings/riscv_slic.rs | 2 +- rtic-monotonics/CHANGELOG.md | 2 +- rtic/Cargo.toml | 1 - rtic/src/export/riscv_common.rs | 1 - xtask/src/argument_parsing.rs | 58 ------------------- xtask/src/main.rs | 9 --- xtask/src/run.rs | 37 ------------ 13 files changed, 3 insertions(+), 114 deletions(-) diff --git a/examples/hifive1/Cargo.toml b/examples/hifive1/Cargo.toml index cd274340d440..42d60a7104cf 100644 --- a/examples/hifive1/Cargo.toml +++ b/examples/hifive1/Cargo.toml @@ -13,7 +13,6 @@ rtic = { path = "../../rtic" } heapless = "0.8.0" hifive1 = { git = "https://github.com/romancardenas/hifive1.git", features = ["board-redv"] } e310x = { git = "https://github.com/greenlsi/e310x.git", features = ["rt"]} -# riscv-rt = {path = "../../../riscv/riscv-rt", features = ["single-hart"]} riscv-rt = {version = "0.12.1", features = ["single-hart"]} riscv = "0.11.0" semihosting = { version = "0.1", features = ["stdio", "panic-handler"] } diff --git a/examples/hifive1/examples/prio_inheritance.rs b/examples/hifive1/examples/prio_inheritance.rs index a1e4a641970e..5fc239964634 100644 --- a/examples/hifive1/examples/prio_inheritance.rs +++ b/examples/hifive1/examples/prio_inheritance.rs @@ -1,6 +1,5 @@ #![no_main] #![no_std] -// #![feature(type_alias_impl_trait)] use riscv_rt as _; diff --git a/examples/hifive1/examples/static.rs b/examples/hifive1/examples/static.rs index 1c115a849d35..34e71c646c9a 100644 --- a/examples/hifive1/examples/static.rs +++ b/examples/hifive1/examples/static.rs @@ -4,7 +4,6 @@ #![deny(warnings)] #![deny(unsafe_code)] #![deny(missing_docs)] -// #![feature(type_alias_impl_trait)] use hifive1 as _; use riscv_rt as _; diff --git a/examples/hifive1/examples/task.rs b/examples/hifive1/examples/task.rs index d647528d7a94..6968edb2212a 100644 --- a/examples/hifive1/examples/task.rs +++ b/examples/hifive1/examples/task.rs @@ -4,7 +4,6 @@ #![deny(warnings)] #![deny(unsafe_code)] #![deny(missing_docs)] -// #![feature(type_alias_impl_trait)] use hifive1 as _; use riscv_rt as _; diff --git a/examples/hifive1/examples/zero_prio_task.rs b/examples/hifive1/examples/zero_prio_task.rs index a05eaaa9771b..2528c4fa15d0 100644 --- a/examples/hifive1/examples/zero_prio_task.rs +++ b/examples/hifive1/examples/zero_prio_task.rs @@ -4,7 +4,6 @@ #![deny(warnings)] #![deny(unsafe_code)] #![deny(missing_docs)] -// #![feature(type_alias_impl_trait)] use core::marker::PhantomData; use hifive1 as _; diff --git a/rtic-macros/CHANGELOG.md b/rtic-macros/CHANGELOG.md index 22fa9d97cb59..a0d761bb2eb1 100644 --- a/rtic-macros/CHANGELOG.md +++ b/rtic-macros/CHANGELOG.md @@ -11,8 +11,8 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Added -- RTIC v2 now works on stable. - Unstable support for RISC-V targets compatible with `riscv-slic` +- RTIC v2 now works on stable. - Unstable ESP32-C3 support. ### Changed diff --git a/rtic-macros/src/codegen/bindings/riscv_slic.rs b/rtic-macros/src/codegen/bindings/riscv_slic.rs index 957b0ff42cec..c9bf50adbfea 100644 --- a/rtic-macros/src/codegen/bindings/riscv_slic.rs +++ b/rtic-macros/src/codegen/bindings/riscv_slic.rs @@ -161,7 +161,7 @@ pub fn architecture_specific_analysis(app: &App, _analysis: &SyntaxAnalysis) -> )); } - Ok(()) // TODO + Ok(()) } /// Macro to add statements to be executed at the beginning of all the interrupt handlers. diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index bac569ddebbb..ef5840fd6338 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -9,8 +9,8 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Changed +- Tweak `build.rs` to avoid warnings in Nightly 1.78+ - Removed unused `rust-toolchain.toml` -Tweak `build.rs` to avoid warnings in Nightly 1.78+ ## v1.5.0 - 2024-01-10 diff --git a/rtic/Cargo.toml b/rtic/Cargo.toml index 3d013579d517..7507a59cd5d8 100644 --- a/rtic/Cargo.toml +++ b/rtic/Cargo.toml @@ -31,7 +31,6 @@ features = ["rtic-macros/test-template"] name = "rtic" [dependencies] -# riscv-slic = { path = "../../riscv-slic/riscv-slic", optional = true } riscv-slic = { git = "https://github.com/romancardenas/riscv-slic.git", rev = "2a91edb", optional = true } esp32c3 = { version = "0.20.0", optional = true} riscv = {version = "0.11.0", optional = true} diff --git a/rtic/src/export/riscv_common.rs b/rtic/src/export/riscv_common.rs index 6bd33b845711..d3028b4d07af 100644 --- a/rtic/src/export/riscv_common.rs +++ b/rtic/src/export/riscv_common.rs @@ -1,5 +1,4 @@ /// GENERIC RE-EXPORTS: needed for all RTIC backends -// pub use riscv::interrupt; /// Read the stack pointer. #[inline(always)] diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index 47e0e886d67a..a3a404f1e57a 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -191,15 +191,6 @@ impl Backends { Backends::Riscv32ImcClint | Backends::Riscv32ImacClint => "riscv-clint", } } - // #[allow(clippy::wrong_self_convention)] - // pub fn to_rtic_uitest_feature(&self) -> &'static str { - // match self { - // Backends::Thumbv6 | Backends::Thumbv8Base => "rtic-uitestv6", - // Backends::Thumbv7 | Backends::Thumbv8Main => "rtic-uitestv7", - // Backends::RiscvEsp32C3 => "rtic-uitestesp32c3", - // Backends::Riscv32ImcClint | Backends::Riscv32ImacClint => "rtic-uitestclint", - // } - // } } #[derive(Copy, Clone, Default, Debug)] @@ -438,55 +429,6 @@ pub enum Commands { /// Build books with mdbook Book(Arg), - - /// Check one or more usage examples. - /// - /// Usage examples are located in ./examples - UsageExampleCheck(UsageExamplesOpt), - - /// Build one or more usage examples. - /// - /// Usage examples are located in ./examples - #[clap(alias = "./examples")] - UsageExampleBuild(UsageExamplesOpt), -} - -#[derive(Args, Clone, Debug)] -pub struct UsageExamplesOpt { - /// The usage examples to build. All usage examples are selected if this argument is not provided. - /// - /// Example: `rp2040_local_i2c_init,stm32f3_blinky`. - examples: Option, -} - -impl UsageExamplesOpt { - pub fn examples(&self) -> anyhow::Result> { - let usage_examples: Vec<_> = std::fs::read_dir("./examples")? - .filter_map(Result::ok) - .filter(|p| p.metadata().ok().map(|p| p.is_dir()).unwrap_or(false)) - .filter_map(|p| p.file_name().to_str().map(ToString::to_string)) - .collect(); - - let selected_examples: Option> = self - .examples - .clone() - .map(|s| s.split(',').map(ToString::to_string).collect()); - - if let Some(selected_examples) = selected_examples { - if let Some(unfound_example) = selected_examples - .iter() - .find(|e| !usage_examples.contains(e)) - { - Err(anyhow::anyhow!( - "Usage example {unfound_example} does not exist" - )) - } else { - Ok(selected_examples) - } - } else { - Ok(usage_examples) - } - } } #[derive(Args, Debug, Clone)] diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 36b0b9050d61..0c56b4271e2d 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -249,15 +249,6 @@ fn main() -> anyhow::Result<()> { info!("Running mdbook"); cargo_book(globals, &args.arguments) } - // TODO these two commands are not needed anymore - Commands::UsageExampleCheck(examples) => { - info!("Checking usage examples"); - cargo_usage_example(globals, BuildOrCheck::Check, examples.examples()?) - } - Commands::UsageExampleBuild(examples) => { - info!("Building usage examples"); - cargo_usage_example(globals, BuildOrCheck::Build, examples.examples()?) - } }; handle_results(globals, final_run_results).map_err(|_| anyhow::anyhow!("Commands failed")) diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 21d16e60800d..ff81e6a2562d 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -199,43 +199,6 @@ pub fn cargo<'c>( runner.run_and_coalesce() } -/// Cargo command to build a usage example. -/// -/// The usage examples are in examples/ -pub fn cargo_usage_example( - globals: &Globals, - operation: BuildOrCheck, - usage_examples: Vec, -) -> Vec> { - into_iter(&usage_examples) - .map(|example| { - let path = format!("examples/{example}"); - - let command = match operation { - BuildOrCheck::Check => CargoCommand::Check { - cargoarg: &None, - mode: BuildMode::Release, - dir: Some(path.into()), - package: None, - target: None, - features: None, - deny_warnings: globals.deny_warnings, - }, - BuildOrCheck::Build => CargoCommand::Build { - cargoarg: &None, - package: None, - target: None, - features: None, - mode: BuildMode::Release, - dir: Some(path.into()), - deny_warnings: globals.deny_warnings, - }, - }; - (globals, command, false) - }) - .run_and_coalesce() -} - /// Cargo command to either build or check all examples /// /// The examples are in examples//examples