Skip to content

Commit 5b02f7a

Browse files
committed
Merge #182
182: Add initial Cluster support r=jamesmunns a=jamesmunns Add cluster support to svd2rust. I am calling it initial, because I have only tested it against the `nRF52` [svd file](https://github.com/jamesmunns/nrf52/blob/master/nrf52.svd). Note, this is based on #180, so I would prefer that PR be merged first. If that PR is rejected, I can instead rebase these changes on `japaric/master` (just let me know). Edit: All changes relevant to clusters are squashed into the last commit of this PR, so if you want to see the relevant changes, check out 6de6de7. This is based on the work of @brandonedens earlier #149, and I believe would close #107 and related issues. CC @japaric @Emilgardis @therealprof Edit 2: Here are some handy references: * [SVD snippet with clusters](https://gist.github.com/jamesmunns/c4e53fe5bd74dca81fdbff6bb1798ddd) * [code generated before](https://gist.github.com/jamesmunns/d854a6c2665cca59edb88143d82a19c6) * [code generated after](https://gist.github.com/jamesmunns/7558667e34c33124c60b3aaaf679a196) * [diff of code generated](https://gist.github.com/jamesmunns/03fd0d7d3595cd0816dbfa8daca0a553)
2 parents 4adcb68 + ef2d9c2 commit 5b02f7a

File tree

6 files changed

+485
-96
lines changed

6 files changed

+485
-96
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ path = "src/main.rs"
2929
[dependencies]
3030
cast = "0.2.2"
3131
clap = "2.26.0"
32+
either = "1.0.3"
3233
error-chain = "0.11.0"
3334
inflections = "1.1.0"
3435
quote = "0.3.15"
35-
svd-parser = "0.5.2"
36+
svd-parser = "0.6"
3637
syn = "0.11.11"

src/generate/device.rs

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub fn render(d: &Device, target: &Target) -> Result<Vec<Tokens>> {
124124
continue;
125125
}
126126

127+
127128
out.extend(peripheral::render(p, &d.peripherals, &d.defaults)?);
128129

129130
if p.registers

0 commit comments

Comments
 (0)