This repository has been archived on 2024-06-16. You can view files and clone it, but cannot push or open issues or pull requests.
va108xx/gen-helper.sh
Robin Mueller 0dcc83720d Updated SVD file handling and README
SVD base file is now created using the svdtools package and a YAML file.
Update README with usage information as well.

This PR also adds new fields for the peripheral clock enable register
in the SVD file
2021-11-04 22:39:53 +01:00

22 lines
611 B
Bash
Executable File

#!/bin/sh
# Use installed tool by default
svd2rust_bin="svd2rust"
# Automates the steps specified in https://docs.rs/svd2rust/0.19.0/svd2rust/
if [ -f svd2rust ]; then
# If the local directory contains svd2rust, use that version instead
svd2rust_bin="./svd2rust"
elif [ -f ../svd2rust ]; then
# Keeps the repository clean
svd2rust_bin="../svd2rust"
fi
if [ -x "$(${svd2rust_bin} --version)" ]; then
echo "No svd2rust found locally or installed." \
"Install it with cargo install svd2rust"
exit
fi
${svd2rust_bin} -i svd/va108xx-base.svd.patched
rm -rf src
form -i lib.rs -o src/ && rm lib.rs
cargo fmt