-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathd
More file actions
executable file
·74 lines (69 loc) · 1.89 KB
/
d
File metadata and controls
executable file
·74 lines (69 loc) · 1.89 KB
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
68
69
70
71
72
73
74
#!/usr/bin/env bash
set -e
cd $(dirname $0)
CMD=$1
# Revision of the data sources
REV=99668fa76f2b3bb81996c24512e494d2c3a8b344
shift
case "$CMD" in
download-all)
rm -rf ./sources/
git clone https://github.com/mspm0-rs/mspm0-data-sources ./sources/ --recursive --shallow-submodules
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
if [[ $f != *.svd ]]; then
continue
fi
f=${f%".svd"}
echo -n processing $f ...
if chiptool extract-peripheral --svd sources/svd/$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 mspm0-data-gen
;;
build-metapac)
rm -rf build/mspm0-metapac
cargo run --release --bin mspm0-metapac-gen
;;
ci)
./d download-all
./d gen
./d build-metapac
./d check
;;
check)
# Iterate over each chip that was generated in metapac and build it.
#
# TODO: Parallelize this to speed up checks?
for feature in build/mspm0-metapac/src/chips/*/; do
feature=$(basename "$feature")
cargo build --release --manifest-path build/mspm0-metapac/Cargo.toml --features pac,metadata,$feature
done
;;
*)
echo "unknown command"
;;
esac