Skip to content

Commit a2a9b72

Browse files
committed
Auto merge of #158 - japaric:singletons, r=japaric
Peripherals as scoped singletons See this RFC for details: #157 With this change device crates will need to depend on a version of the cortex-m crate that includes rust-embedded/cortex-m#65 ### TODO - [x] accept the RFC - [ ] Check that non cortex-m targets still work - [x] decide on better names for `Peripherals::{all,_all}`
2 parents 5cc57ba + e114878 commit a2a9b72

File tree

9 files changed

+380
-460
lines changed

9 files changed

+380
-460
lines changed

.rustfmt.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ matrix:
4747
os: osx
4848

4949
install:
50-
- sh ci/install.sh
50+
- bash ci/install.sh
5151

5252
script:
5353
- bash ci/script.sh

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ keywords = [
1919
license = "MIT OR Apache-2.0"
2020
name = "svd2rust"
2121
repository = "https://github.com/japaric/svd2rust"
22-
version = "0.11.4"
22+
version = "0.12.0"
2323

2424
[[bin]]
2525
doc = false

build.rs

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,21 @@ fn commit_info() -> String {
3333
}
3434

3535
fn commit_hash() -> Result<String, IgnoredError> {
36-
Ok(
36+
Ok(try!(String::from_utf8(
3737
try!(
38-
String::from_utf8(
39-
try!(
40-
Command::new("git")
41-
.args(&["rev-parse", "--short", "HEAD"])
42-
.output()
43-
)
44-
.stdout,
45-
)
46-
),
47-
)
38+
Command::new("git")
39+
.args(&["rev-parse", "--short", "HEAD"])
40+
.output()
41+
).stdout,
42+
)))
4843
}
4944

5045
fn commit_date() -> Result<String, IgnoredError> {
51-
Ok(
46+
Ok(try!(String::from_utf8(
5247
try!(
53-
String::from_utf8(
54-
try!(
55-
Command::new("git")
56-
.args(
57-
&[
58-
"log",
59-
"-1",
60-
"--date=short",
61-
"--pretty=format:%cd",
62-
],
63-
)
64-
.output()
65-
)
66-
.stdout,
67-
)
68-
),
69-
)
48+
Command::new("git")
49+
.args(&["log", "-1", "--date=short", "--pretty=format:%cd"])
50+
.output()
51+
).stdout,
52+
)))
7053
}

ci/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set -ex
1+
set -euxo pipefail
22

33
main() {
44
local sort=

ci/script.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
set -ex
2-
set -o pipefail
1+
set -euxo pipefail
32

43
test_svd() {
54
(
@@ -15,7 +14,7 @@ test_svd() {
1514
}
1615

1716
main() {
18-
cross build --target $TARGET
17+
cross check --target $TARGET
1918

2019
if [ -z $VENDOR ]; then
2120
return
@@ -35,7 +34,7 @@ main() {
3534
# test crate
3635
cargo init --name foo $td
3736
echo 'bare-metal = "0.1.0"' >> $td/Cargo.toml
38-
echo 'cortex-m = "0.3.0"' >> $td/Cargo.toml
37+
echo 'cortex-m = { git = "https://github.com/japaric/cortex-m" }' >> $td/Cargo.toml
3938
echo 'cortex-m-rt = "0.3.0"' >> $td/Cargo.toml
4039
echo 'vcell = "0.1.0"' >> $td/Cargo.toml
4140

@@ -609,6 +608,6 @@ main() {
609608
rm -rf $td
610609
}
611610

612-
if [ -z $TRAVIS_TAG ]; then
611+
if [ -z ${TRAVIS_TAG-} ]; then
613612
main
614613
fi

0 commit comments

Comments
 (0)