Skip to content

Commit

Permalink
fix: Update diagram.json
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Nov 28, 2024
1 parent bd644f1 commit b0bf88e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,23 @@ fn main() -> Result<(), Box<dyn Error>> {
"xtensa".to_string()
});

let wokwi_devkit = match args.chip {
Chip::Esp32 => "board-esp32-devkit-c-v4",
Chip::Esp32c2 => {
log::error!("ESP32-C2 not supported by Wokwi",);
process::exit(-1);
}
Chip::Esp32c3 => "board-esp32-c3-devkitm-1",
Chip::Esp32c6 => "board-esp32-c6-devkitc-1",
Chip::Esp32h2 => "board-esp32-h2-devkitm-1",
Chip::Esp32s2 => "board-esp32-s2-devkitm-1",
Chip::Esp32s3 => "board-esp32-s3-devkitc-1",
};

let mut variables = vec![
("project-name".to_string(), args.name.clone()),
("mcu".to_string(), args.chip.to_string()),
("wokwi-board".to_string(), wokwi_devkit.to_string()),
];

variables.push(("rust_target".to_string(), args.chip.target().to_string()));
Expand Down
4 changes: 2 additions & 2 deletions template/diagram.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{
"version": 1,
"editor": "wokwi",
"author": "{{authors}}",
"parts": [
{
"type": "{{ wokwi_board }}",
//REPLACE wokwi-board wokwi-board
"type": "wokwi-board",
"id": "esp",
"top": 0.59,
"left": 0.67,
Expand Down

0 comments on commit b0bf88e

Please sign in to comment.