feat: Add some methods to get the target arch

This commit is contained in:
Sergio Gasquez 2022-12-23 12:26:53 +00:00
parent 736627d35f
commit c85e24a6c7

View File

@ -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<HashSet<Target>, Error> {
debug!("{} Parsing targets: {}", emoji::DEBUG, targets_str);