From 906278e31026df8874b1b1593af8f92ce6d7e247 Mon Sep 17 00:00:00 2001 From: onsdagens <112828711+onsdagens@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:35:41 +0200 Subject: Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adjust esp32c3 codegen, bump pac to 0.21.0 * add esp32c3 example * adjust workflow flags * CI: Fix esp32c3 comment * esp32c3: Remove commented out git-dep * CI: Actually check the ESP32-C3 examples * Autoformat rtic/cargo.toml --------- Co-authored-by: Henrik Tjäder --- xtask/src/argument_parsing.rs | 12 ++++++++++-- xtask/src/main.rs | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index a3a404f..f72be77 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -166,8 +166,8 @@ impl Backends { Backends::Thumbv7 => ARMV7M, Backends::Thumbv8Base => ARMV8MBASE, Backends::Thumbv8Main => ARMV8MMAIN, - Backends::Riscv32ImcClint => RISCV32IMC, - Backends::RiscvEsp32C3 | Backends::Riscv32ImacClint => RISCV32IMAC, + Backends::Riscv32ImcClint | Backends::RiscvEsp32C3 => RISCV32IMC, + Backends::Riscv32ImacClint => RISCV32IMAC, } } @@ -202,6 +202,7 @@ pub enum BuildOrCheck { #[derive(clap::ValueEnum, Copy, Clone, Default, Debug)] pub enum Platforms { + Esp32C3, Hifive1, #[default] Lm3s6965, @@ -215,6 +216,7 @@ pub enum Platforms { impl Platforms { pub fn name(&self) -> String { let name = match self { + Platforms::Esp32C3 => "esp32c3", Platforms::Hifive1 => "hifive1", Platforms::Lm3s6965 => "lm3s6965", Platforms::Nrf52840 => "nrf52840", @@ -230,6 +232,7 @@ impl Platforms { pub fn rust_flags(&self) -> Vec { let c = "-C".to_string(); match self { + Platforms::Esp32C3 => vec![c, "link-arg=-Tlinkall.x".to_string()], Platforms::Hifive1 => vec![c, "link-arg=-Thifive1-link.x".to_string()], Platforms::Lm3s6965 => vec![c, "link-arg=-Tlink.x".to_string()], Platforms::Nrf52840 => vec![ @@ -267,6 +270,7 @@ impl Platforms { /// Get the default backend for the platform pub fn default_backend(&self) -> Backends { match self { + Platforms::Esp32C3 => Backends::RiscvEsp32C3, Platforms::Hifive1 => Backends::Riscv32ImcClint, Platforms::Lm3s6965 => Backends::Thumbv7, Platforms::Nrf52840 => unimplemented!(), @@ -282,6 +286,10 @@ impl Platforms { /// If the backend is supported, but no special features are needed, return Ok(None). pub fn features(&self, backend: &Backends) -> Result, ()> { match self { + Platforms::Esp32C3 => match backend.to_target() { + RISCV32IMC => Ok(None), + _ => Err(()), + }, Platforms::Hifive1 => match backend.to_target() { RISCV32IMC | RISCV32IMAC => Ok(None), _ => Err(()), diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0c56b42..1eddcff 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -109,7 +109,6 @@ fn main() -> anyhow::Result<()> { backend )); } - let examples_path = format!("./examples/{}/examples", platform.name()); let examples: Vec<_> = std::fs::read_dir(examples_path)? .filter_map(|p| p.ok()) -- cgit v1.2.3