Skip to content

Commit

Permalink
Remove ch32x034 and fix ch32v303 target
Browse files Browse the repository at this point in the history
  • Loading branch information
romainreignier committed Sep 3, 2024
1 parent 0219fe1 commit 3219b2d
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 16 deletions.
89 changes: 75 additions & 14 deletions cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,101 @@ post = ["post-script.rhai"]
[placeholders.mcu_family]
type = "string"
prompt = "Which MCU family to target?"
choices = ["ch32l003", "ch32v003", "ch32v103", "ch32v203", "ch32v208", "ch32v303", "ch32v305", "ch32v307", "ch32x033", "ch32x034", "ch32x035", "ch641"]
choices = [
"ch32l003",
"ch32v003",
"ch32v103",
"ch32v203",
"ch32v208",
"ch32v303",
"ch32v305",
"ch32v307",
"ch32x033",
"ch32x035",
"ch641",
]
default = "ch32v003"

[conditional.'mcu_family != "ch32v003 || mcu_family != "ch641"']
ignore = [ "riscv32ec-unknown-none-elf.json" ]
ignore = ["riscv32ec-unknown-none-elf.json"]

[conditional.'mcu_family == "ch32l003"'.placeholders]
mcu = { type = "string", prompt = "Which ch32l003 variant to use?", choices = ["ch32l103c8t6", "ch32l103f7p6", "ch32l103f8p6", "ch32l103f8u6", "ch32l103g8r6", "ch32l103k8u6"], default = "ch32l103f8p6" }
mcu = { type = "string", prompt = "Which ch32l003 variant to use?", choices = [
"ch32l103c8t6",
"ch32l103f8p6",
"ch32l103f8u6",
"ch32l103g8r6",
"ch32l103k8u6",
], default = "ch32l103f8p6" }

[conditional.'mcu_family == "ch32v003"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v003 variant to use?", choices = ["ch32v003a4m6", "ch32v003f4p6", "ch32v003f4u6", "ch32v003j4m6"], default = "ch32v003f4p6" }
mcu = { type = "string", prompt = "Which ch32v003 variant to use?", choices = [
"ch32v003a4m6",
"ch32v003f4p6",
"ch32v003f4u6",
"ch32v003j4m6",
], default = "ch32v003f4p6" }

[conditional.'mcu_family == "ch32v103"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v103 variant to use?", choices = ["ch32v103c6t6", "ch32v103c8t6", "ch32v103c8u6", "ch32v103r8t6"], default = "ch32v103c8t6" }
mcu = { type = "string", prompt = "Which ch32v103 variant to use?", choices = [
"ch32v103c6t6",
"ch32v103c8t6",
"ch32v103c8u6",
"ch32v103r8t6",
], default = "ch32v103c8t6" }

[conditional.'mcu_family == "ch32v203"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v203 variant to use?", choices = ["ch32v203c8t6", "ch32v203c8u6", "ch32v203f6p6", "ch32v203f8p6", "ch32v203f8u6", "ch32v203g6u6", "ch32v203g8r6", "ch32v203k6t6", "ch32v203k8t6", "ch32v203rbt6"], default = "ch32v203c8t6" }
mcu = { type = "string", prompt = "Which ch32v203 variant to use?", choices = [
"ch32v203c8t6",
"ch32v203c8u6",
"ch32v203f6p6",
"ch32v203f8p6",
"ch32v203f8u6",
"ch32v203g6u6",
"ch32v203g8r6",
"ch32v203k6t6",
"ch32v203k8t6",
"ch32v203rbt6",
], default = "ch32v203c8t6" }

[conditional.'mcu_family == "ch32v208"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v208 variant to use?", choices = ["ch32v208cbu6", "ch32v208gbu6", "ch32v208rbt6", "ch32v208wbu6"], default = "ch32v208rbt6" }
mcu = { type = "string", prompt = "Which ch32v208 variant to use?", choices = [
"ch32v208cbu6",
"ch32v208gbu6",
"ch32v208rbt6",
"ch32v208wbu6",
], default = "ch32v208rbt6" }

[conditional.'mcu_family == "ch32v303"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v303 variant to use?", choices = ["ch32v303cbt6", "ch32v303rbt6", "ch32v303rct6", "ch32v303vct6"], default = "ch32v303rbt6" }
mcu = { type = "string", prompt = "Which ch32v303 variant to use?", choices = [
"ch32v303cbt6",
"ch32v303rbt6",
"ch32v303rct6",
"ch32v303vct6",
], default = "ch32v303rbt6" }

[conditional.'mcu_family == "ch32v305"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v305 variant to use?", choices = ["ch32v305fbp6", "ch32v305gbu6", "ch32v305rbt6"], default = "ch32v305rbt6" }
mcu = { type = "string", prompt = "Which ch32v305 variant to use?", choices = [
"ch32v305fbp6",
"ch32v305gbu6",
"ch32v305rbt6",
], default = "ch32v305rbt6" }

[conditional.'mcu_family == "ch32v307"'.placeholders]
mcu = { type = "string", prompt = "Which ch32v307 variant to use?", choices = ["ch32v307rct6", "ch32v307vct6", "ch32v307wcu6"], default = "ch32v307vct6" }
mcu = { type = "string", prompt = "Which ch32v307 variant to use?", choices = [
"ch32v307rct6",
"ch32v307vct6",
"ch32v307wcu6",
], default = "ch32v307vct6" }

# ch32x033 and ch641 families have only one variant per family, handled in pre-script.rhai

[conditional.'mcu_family == "ch32x034"'.placeholders]
mcu = { type = "string", prompt = "Which ch32x034 variant to use?", choices = ["ch32x034f8p6", "ch32x034f8u6"], default = "ch32x034f8p6" }

[conditional.'mcu_family == "ch32x035"'.placeholders]
mcu = { type = "string", prompt = "Which ch32x035 variant to use?", choices = ["ch32x035c8t6", "ch32x035f7p6", "ch32x035f8u6", "ch32x035g8r6", "ch32x035g8u6", "ch32x035r8t6"], default = "ch32x035f7p6" }
mcu = { type = "string", prompt = "Which ch32x035 variant to use?", choices = [
"ch32x035c8t6",
"ch32x035f7p6",
"ch32x035f8u6",
"ch32x035g8r6",
"ch32x035g8u6",
"ch32x035r8t6",
], default = "ch32x035f7p6" }
3 changes: 1 addition & 2 deletions pre-script.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ let targets = #{
ch32v103: "riscv32imac-unknown-none-elf",
ch32v203: "riscv32imac-unknown-none-elf",
ch32v208: "riscv32imac-unknown-none-elf",
ch32v303: "riscv32imac-unknown-none-elf",
ch32v303: "riscv32imafc-unknown-none-elf",
ch32v305: "riscv32imafc-unknown-none-elf",
ch32v307: "riscv32imafc-unknown-none-elf",
ch32x033: "riscv32imac-unknown-none-elf",
ch32x034: "riscv32imac-unknown-none-elf",
ch32x035: "riscv32imac-unknown-none-elf",
};

Expand Down

0 comments on commit 3219b2d

Please sign in to comment.