Skip to content

Commit c849aa2

Browse files
committed
remove form dependency
1 parent 7b4cb83 commit c849aa2

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ jobs:
2626
id: cache-cargo
2727
with:
2828
path: ~/cargo-bin
29-
key: rust-tools-20250106-001
29+
key: rust-tools-20250112-001
3030
- name: Install svd2rust
3131
if: steps.cache-cargo.outputs.cache-hit != 'true'
3232
run: cargo install svd2rust --version 0.28.0 --locked
33-
- name: Install cargo-form
34-
if: steps.cache-cargo.outputs.cache-hit != 'true'
35-
run: cargo install form --version 0.8.0 --locked
3633
- name: Install atdf2svd
3734
if: steps.cache-cargo.outputs.cache-hit != 'true'
3835
run: cargo install atdf2svd --version 0.5.0 --locked
@@ -44,7 +41,6 @@ jobs:
4441
run: |
4542
mkdir ~/cargo-bin
4643
cp ~/.cargo/bin/svd2rust ~/cargo-bin
47-
cp ~/.cargo/bin/form ~/cargo-bin
4844
cp ~/.cargo/bin/atdf2svd ~/cargo-bin
4945
cp ~/.cargo/bin/svdtools ~/cargo-bin
5046
- name: Put new cargo binary directory into path

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Cargo.lock
55

66
svd/
77
.deps/
8-
src/devices/*/*
8+
src/devices/*.rs
9+
!src/devices/mod.rs
910
src/generic.rs
1011
__pycache__/

Makefile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ chips: $(CHIPS)
1212
deps: $(DEPS)
1313
vector: macros/src/vector.rs
1414

15-
$(foreach chip, $(CHIPS), $(eval $(chip): src/devices/$(chip)/mod.rs))
15+
$(foreach chip, $(CHIPS), $(eval $(chip): src/devices/$(chip).rs))
1616

1717
.SECONDARY:
1818
svd/%.svd: vendor/%.atdf
@@ -30,21 +30,14 @@ svd/%.svd.patched: svd/%.svd .deps/%.d patch/%.yaml
3030
cp $< $@; \
3131
fi
3232

33-
src/devices/%/mod.full.rs: svd/%.svd.patched
34-
@mkdir -p $(@D)
33+
src/devices/%.rs: svd/%.svd.patched
34+
@mkdir -p $(@D)/$*
3535
@echo -e "\tSVD2RUST\t$*"
36-
@cd $(@D); svd2rust --generic_mod --make_mod --target none -i $(realpath $<)
37-
@mv $(@D)/mod.rs $@
38-
@mv $(@D)/generic.rs $(@D)/../../generic.rs
39-
40-
src/devices/%/mod.rs: src/devices/%/mod.full.rs
41-
@echo -e "\tFORM\t\t$*"
42-
@RUST_LOG=WARN form -i $< -o $(@D) >/dev/null
43-
@rm $<
44-
@mv $(@D)/lib.rs $@
36+
@cd $(@D)/$*; svd2rust --generic_mod --make_mod --target none -i $(realpath $<)
37+
@mv $(@D)/$*/mod.rs $@
38+
@mv $(@D)/$*/generic.rs $(@D)/../generic.rs
39+
@rmdir $(@D)/$*
4540
@RUSTUP_TOOLCHAIN=$(RUSTUP_TOOLCHAIN) rustfmt $@
46-
@# Remove the `extern crate` lines
47-
@sed -i'' -e "/^extern crate/d" $@
4841
@# Remove DEVICE_PERIPHERALS declaration and replace it with a reference
4942
@# to the global version
5043
@patch --no-backup-if-mismatch --quiet $@ patch/modrs.patch

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,16 @@ Via the feature you can select which chip you want the register specifications f
4040
## Build Instructions
4141
The version on `crates.io` is pre-built. The following is only necessary when trying to build this crate from source.
4242

43-
You need to have [atdf2svd][] (= 0.5.0), [svd2rust][] (= 0.28), [form][] (>= 0.8), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (= 0.4.0) installed:
43+
You need to have [atdf2svd][] (= 0.5.0), [svd2rust][] (= 0.28), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (= 0.4.0) installed:
4444
```bash
4545
cargo install atdf2svd --version 0.5.0 --locked
4646
cargo install svd2rust --version 0.28.0 --locked
47-
cargo install form
4847
rustup component add --toolchain nightly rustfmt
4948
cargo install svdtools --version 0.4.0 --locked
5049
```
5150

5251
[atdf2svd]: https://github.com/Rahix/atdf2svd
5352
[svd2rust]: https://github.com/rust-embedded/svd2rust
54-
[form]: https://github.com/djmcgill/form
5553
[rustfmt]: https://github.com/rust-lang/rustfmt
5654
[svdtools]: https://github.com/stm32-rs/svdtools
5755

0 commit comments

Comments
 (0)