aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/argument_parsing.rs
diff options
context:
space:
mode:
authoronsdagens <112828711+onsdagens@users.noreply.github.com>2024-04-04 11:35:41 +0200
committerGitHub <noreply@github.com>2024-04-04 09:35:41 +0000
commit906278e31026df8874b1b1593af8f92ce6d7e247 (patch)
treed77ade2744c2c13d2706831236e7904ffd183435 /xtask/src/argument_parsing.rs
parent53ed7bf7edb21180cb18c0bf6a7dbe6168331879 (diff)
Adjust esp32c3 codegen, bump pac to 0.21.0 (#906)
* 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 <henrik@tjaders.com>
Diffstat (limited to 'xtask/src/argument_parsing.rs')
-rw-r--r--xtask/src/argument_parsing.rs12
1 files changed, 10 insertions, 2 deletions
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<String> {
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<Option<&'static str>, ()> {
match self {
+ Platforms::Esp32C3 => match backend.to_target() {
+ RISCV32IMC => Ok(None),
+ _ => Err(()),
+ },
Platforms::Hifive1 => match backend.to_target() {
RISCV32IMC | RISCV32IMAC => Ok(None),
_ => Err(()),