forked from embassy-rs/stm32-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d
executable file
·67 lines (62 loc) · 1.83 KB
/
d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -e
cd $(dirname $0)
CMD=$1
REV=74b97817d4c4ed0db9d19a8eac46720b3c5b0d57
shift
case "$CMD" in
download-all)
rm -rf ./sources/
git clone https://github.com/embassy-rs/stm32-data-sources.git ./sources/ -q
cd ./sources/
git checkout $REV
;;
install-chiptool)
cargo install --git https://github.com/embassy-rs/chiptool
;;
extract-all)
peri=$1
shift
echo $@
rm -rf tmp/$peri
mkdir -p tmp/$peri
for f in `ls sources/svd`; do
f=${f#"stm32"}
f=${f%".svd"}
echo -n processing $f ...
if chiptool extract-peripheral --svd sources/svd/stm32$f.svd --peripheral $peri $@ > tmp/$peri/$f.yaml 2> tmp/$peri/$f.err; then
rm tmp/$peri/$f.err
echo OK
else
if grep -q 'peripheral not found' tmp/$peri/$f.err; then
echo No Peripheral
else
echo OTHER FAILURE
fi
rm tmp/$peri/$f.yaml
fi
done
;;
gen)
rm -rf build/data
cargo run --release --bin stm32-data-gen
;;
ci)
[ -d sources ] || ./d download-all
cd ./sources/
git fetch origin $REV
git checkout $REV
cd ..
rm -rf build/{data,stm32-metapac}
cargo run --release --bin stm32-data-gen
cargo run --release --bin stm32-metapac-gen
cd build/stm32-metapac
#find . -name '*.rs' -not -path '*target*' | xargs rustfmt --skip-children --unstable-features --edition 2021
cargo check --features stm32h755zi-cm7,pac,metadata
cargo check --features stm32f777zi,pac
cargo check --features stm32u585zi,metadata
;;
*)
echo "unknown command"
;;
esac