Skip to content

Commit

Permalink
feat: ✨ Add ESP32-H2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Apr 19, 2023
1 parent a49f0b6 commit 3ee27ea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Options:
With this option, espup will skip GCC installation (it will be handled by esp-idf-sys), hence you won't be able to build no_std applications.
-t, --targets <TARGETS>
Comma or space separated list of targets [esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,all]
Comma or space separated list of targets [esp32,esp32c2,esp32c3,esp32c6,esp32h2,esp32s2,esp32s3,all]
[default: all]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct InstallOpts {
/// With this option, espup will skip GCC installation (it will be handled by esp-idf-sys), hence you won't be able to build no_std applications.
#[arg(short = 's', long)]
pub std: bool,
/// Comma or space separated list of targets [esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,all].
/// Comma or space separated list of targets [esp32,esp32c2,esp32c3,esp32c6,esp32h2,esp32s2,esp32s3,all].
#[arg(short = 't', long, default_value = "all", value_parser = parse_targets)]
pub targets: HashSet<Target>,
/// Xtensa Rust toolchain version.
Expand Down
15 changes: 9 additions & 6 deletions src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ use strum::{Display, EnumIter, EnumString, IntoEnumIterator};
pub enum Target {
/// Xtensa LX6 based dual core
ESP32 = 0,
/// Xtensa LX7 based single core
ESP32S2,
/// Xtensa LX7 based dual core
ESP32S3,
/// RISC-V based single core
ESP32C2,
/// RISC-V based single core
ESP32C3,
/// RISC-V based single core
ESP32C6,
/// RISC-V based single core
ESP32H2,
/// Xtensa LX7 based single core
ESP32S2,
/// Xtensa LX7 based dual core
ESP32S3,
}

impl Target {
Expand Down Expand Up @@ -82,11 +84,12 @@ mod tests {
));
let targets: HashSet<Target> = [
Target::ESP32,
Target::ESP32S2,
Target::ESP32S3,
Target::ESP32C2,
Target::ESP32C3,
Target::ESP32C6,
Target::ESP32H2,
Target::ESP32S2,
Target::ESP32S3,
]
.into_iter()
.collect();
Expand Down
2 changes: 1 addition & 1 deletion src/toolchain/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub fn get_gcc_name(target: &Target) -> String {
Target::ESP32 => ESP32_GCC,
Target::ESP32S2 => ESP32S2_GCC,
Target::ESP32S3 => ESP32S3_GCC,
Target::ESP32C2 | Target::ESP32C3 | Target::ESP32C6 => RISCV_GCC,
Target::ESP32C2 | Target::ESP32C3 | Target::ESP32C6 | Target::ESP32H2 => RISCV_GCC,
};
toolchain.to_string()
}
Expand Down

0 comments on commit 3ee27ea

Please sign in to comment.