Skip to content

Commit

Permalink
[Fixes #12] Mark outdated nature of Hardware Revision A (#13)
Browse files Browse the repository at this point in the history
* [Fixes #12] Use different `README.md` template for revision A
* [Fixes #12] Amend the `README.md.revA.template` file
    The modification explains the **Hardware Revision A** refers to potentially outdated chip variant no longer manufactured.
* [Fixes #12] Address review suggestions
  • Loading branch information
michalfita authored Apr 20, 2022
1 parent 96a21ed commit 0c59041
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions pac/README.md.revA.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Peripheral Access Crate ${crate} for ${mcu} 32-bit MCU from Atmel/Microchip

This PAC crate relates to **Hardware Revision A** that has been superseded by **Hardware Revision B** (refer to the [`${crate}b`](https://https://crates.io/crates/${crate}b) crate). The former is no longer in production.

This crate contains autogenerated code to access peripherals of ${mcu} generated from official SVD files from Microchip mirrored at [posborne/cmsis-svd](https://github.com/posborne/cmsis-svd) using [svd2rust](https://github.com/rust-embedded/svd2rust/) tool.

## License

[BSD Zero Clause License](https://choosealicense.com/licenses/0bsd/)
File renamed without changes.
5 changes: 3 additions & 2 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

def generate_cargo(crate: str, location: pathlib.Path):
template = ""
with open("Cargo.toml.template") as templatefile:
with open("pac/Cargo.toml.template") as templatefile:
template = templatefile.read()
with open(location.joinpath("Cargo.toml"), "w") as cargotomlfile:
cargotomlcontent = string.Template(template).substitute(crate=crate, mcu=crate.upper())
cargotomlfile.write(cargotomlcontent)

def generate_readme(crate: str, location: pathlib.Path):
template = ""
with open("README.md.template") as templatefile:
template_filename = "pac/README.md.template" if crate[-1:] == 'b' else "pac/README.md.revA.template"
with open(template_filename) as templatefile:
template = templatefile.read()
with open(location.joinpath("README.md"), "w") as cargotomlfile:
cargotomlcontent = string.Template(template).substitute(crate=crate, mcu=crate.upper())
Expand Down

0 comments on commit 0c59041

Please sign in to comment.