From c85e24a6c7a1c11f6a3b4adc543618d83286aa04 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 23 Dec 2022 12:26:53 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Add=20some=20methods=20to?= =?UTF-8?q?=20get=20the=20target=20arch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/targets.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/targets.rs b/src/targets.rs index be2a4a7..d0ae138 100644 --- a/src/targets.rs +++ b/src/targets.rs @@ -25,6 +25,16 @@ pub enum Target { ESP32C3, } +impl Target { + pub fn riscv(&self) -> bool { + !self.xtensa() + } + + pub fn xtensa(&self) -> bool { + matches!(self, Target::ESP32 | Target::ESP32S2 | Target::ESP32S3) + } +} + /// Returns a vector of Chips from a comma or space separated string. pub fn parse_targets(targets_str: &str) -> Result, Error> { debug!("{} Parsing targets: {}", emoji::DEBUG, targets_str);