mirror of
https://github.com/esp-rs/espup.git
synced 2025-10-02 15:14:56 +00:00
feat: ✨ Add some methods to get the target arch
This commit is contained in:
parent
736627d35f
commit
c85e24a6c7
@ -25,6 +25,16 @@ pub enum Target {
|
|||||||
ESP32C3,
|
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.
|
/// Returns a vector of Chips from a comma or space separated string.
|
||||||
pub fn parse_targets(targets_str: &str) -> Result<HashSet<Target>, Error> {
|
pub fn parse_targets(targets_str: &str) -> Result<HashSet<Target>, Error> {
|
||||||
debug!("{} Parsing targets: {}", emoji::DEBUG, targets_str);
|
debug!("{} Parsing targets: {}", emoji::DEBUG, targets_str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user