Skip to content

Commit 9aa46aa

Browse files
committed
Removed changes from lib.rs file and synced upstream master
2 parents cfc7017 + f88ddc5 commit 9aa46aa

34 files changed

+616
-1313
lines changed

.github/bors.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
4-
status = ["continuous-integration/travis-ci/push"]
4+
status = [
5+
"ci-linux (stable, x86_64-unknown-linux-gnu)",
6+
"ci-linux (stable, thumbv6m-none-eabi)",
7+
"ci-linux (stable, thumbv7m-none-eabi)",
8+
"ci-linux (1.35.0, x86_64-unknown-linux-gnu)",
9+
]

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
# All generated code should be running on stable now
14+
rust: [stable]
15+
16+
# The default target we're compiling on and for
17+
TARGET: [x86_64-unknown-linux-gnu, thumbv6m-none-eabi, thumbv7m-none-eabi]
18+
19+
include:
20+
# Test MSRV
21+
- rust: 1.35.0
22+
TARGET: x86_64-unknown-linux-gnu
23+
24+
# Test nightly but don't fail
25+
- rust: nightly
26+
experimental: true
27+
TARGET: x86_64-unknown-linux-gnu
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions-rs/toolchain@v1
32+
with:
33+
profile: minimal
34+
toolchain: ${{ matrix.rust }}
35+
target: ${{ matrix.TARGET }}
36+
override: true
37+
- uses: actions-rs/cargo@v1
38+
with:
39+
command: check
40+
args: --target=${{ matrix.TARGET }}

.github/workflows/clippy.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Clippy check
7+
jobs:
8+
clippy_check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
profile: minimal
15+
toolchain: stable
16+
override: true
17+
components: clippy
18+
- uses: actions-rs/clippy-check@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rustfmt.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Code formatting check
7+
8+
jobs:
9+
fmt:
10+
name: Rustfmt
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: stable
18+
override: true
19+
components: rustfmt
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: fmt
23+
args: --all -- --check

.travis.yml

-46
This file was deleted.

CHANGELOG.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
89
## [Unreleased]
910

11+
## [v1.0.0-alpha.1] - 2020-06-16
12+
13+
*** This is an alpha release with breaking changes (sorry) ***
14+
1015
### Added
1116
- A nonblocking trait for interfacing with random number generation hardware.
1217

1318
### Changed
14-
- The current versions of `InputPin` have been proven. These are `digital::v1::InputPin`
15-
and `digital::v2::InputPin`.
19+
- All traits have been marked as proven (`unproven` feature has been removed).
20+
- All trait methods have been made fallible.
21+
- All trait methods have been renamed `try_*` (i.e. `try_send`) for consistency.
22+
- The `Capture`, `Pwm`, `PwmPin` and `Qei` traits have been moved into their own
23+
`capture`, `pwm` and `qei` modules for consistency.
24+
- Void has been replaced with `core::convert::Infallible` which should be used
25+
in trait implementations where methods cannot fail.
26+
- A new [process](https://github.com/rust-embedded/embedded-hal#how-to-add-a-new-trait)
27+
has been adopted for the addition of traits to the embedded-hal.
28+
- The minimum supported Rust version is 1.35 due to [this issue](https://github.com/rust-lang/rust/issues/54973).
1629

1730
## [v0.2.3] - 2019-05-09
1831

@@ -99,8 +112,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99112

100113
Initial release
101114

102-
[Unreleased]: https://github.com/japaric/embedded-hal/compare/v0.2.1...HEAD
103-
[v0.2.1]: https://github.com/japaric/embedded-hal/compare/v0.2.0...v0.2.1
104-
[v0.2.0]: https://github.com/japaric/embedded-hal/compare/v0.1.2...v0.2.0
105-
[v0.1.2]: https://github.com/japaric/embedded-hal/compare/v0.1.1...v0.1.2
106-
[v0.1.1]: https://github.com/japaric/embedded-hal/compare/v0.1.0...v0.1.1
115+
[Unreleased]: https://github.com/rust-embedded/embedded-hal/compare/v1.0.0-alpha.1...HEAD
116+
[v1.0.0-alpha.1]: https://github.com/rust-embedded/embedded-hal/compare/v0.2.3...v1.0.0-alpha.1
117+
[v0.2.3]: https://github.com/rust-embedded/embedded-hal/compare/v0.2.2...v0.2.3
118+
[v0.2.2]: https://github.com/rust-embedded/embedded-hal/compare/v0.2.1...v0.2.2
119+
[v0.2.1]: https://github.com/rust-embedded/embedded-hal/compare/v0.2.0...v0.2.1
120+
[v0.2.0]: https://github.com/rust-embedded/embedded-hal/compare/v0.1.2...v0.2.0
121+
[v0.1.2]: https://github.com/rust-embedded/embedded-hal/compare/v0.1.1...v0.1.2
122+
[v0.1.1]: https://github.com/rust-embedded/embedded-hal/compare/v0.1.0...v0.1.1

Cargo.toml

+3-8
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@ license = "MIT OR Apache-2.0"
1212
name = "embedded-hal"
1313
readme = "README.md"
1414
repository = "https://github.com/rust-embedded/embedded-hal"
15-
version = "0.2.3"
15+
version = "1.0.0-alpha.1"
1616

17-
[dependencies.nb]
18-
version = "0.1.1"
17+
[dependencies]
18+
nb = { version = "0.1.1", features = ["unstable"] }
1919

2020
[dev-dependencies]
2121
stm32f3 = { version = "0.8", features = ["stm32f303", "rt"] }
2222
futures = "0.1.17"
2323

24-
[features]
25-
unproven = ["nb/unstable"]
26-
27-
[package.metadata.docs.rs]
28-
features = ["unproven"]

README.md

+18-30
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,29 @@ This project is developed and maintained by the [HAL team][team].
1212

1313
This is the suggested approach to adding a new trait to `embedded-hal`
1414

15-
### Discussion
15+
### Research / Discussion
1616

17-
Ideally, before proposing a new trait, or set of traits, you should create an issue where the use
18-
cases and requirements of the trait(s) are discussed.
17+
Ideally, before proposing a new trait, or set of traits, you should check for an existing issue
18+
suggesting the need for the trait, as well as any related works / use cases / requirements that
19+
are useful to consider in the design of the trait.
1920

20-
These issues will be labeled as `discussion`s in the issue tracker.
21+
These issues will be labeled as `discussion` in the issue tracker.
2122

22-
### Proposing a trait
23-
24-
Once there's consensus on the requirements of the trait(s) a new issue, or a PR, with a proposal
25-
should be opened. The proposal should include the actual trait definitions as well as a link to the
26-
issue with previous discussion, if there was one.
23+
### Implementation / Demonstration
2724

28-
If the proposal includes more than one alternative then there should be further discussion to try to
29-
single out the best alternative.
25+
Proposed traits should then be implemented and demonstrated, either by forking `embedded-hal` or by creating a new crate with the intent of integrating this into `embedded-hal` once the traits have stabilized. You may find [cargo workspaces](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) and [patch](https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html) useful for the forking approach.
3026

31-
These issues / PRs will be labeled as `proposal`s in the issue tracker.
27+
Traits should be demonstrated with at least *two* implementations on different platforms and *one* generic driver built on the trait. Where it is possible we suggest an implementation on a microcontroller, and implementation for [linux](https://github.com/rust-embedded/linux-embedded-hal), and a driver (or drivers where requirements are more complex) with bounds using the trait.
3228

33-
### Testing period
29+
### Proposing a trait
3430

35-
If there are no objections to the proposal the new trait(s) will land behind the "unproven" Cargo
36-
feature and an issue about the new trait(s) will be created. If the proposal includes several
37-
alternatives and a single one couldn't be chosen as the best then each alternative will land behind
38-
a different Cargo feature, e.g. "alt1" or "alt2".
31+
Once the trait has been demonstrated a PR should be opened to merge the new trait(s) into `embedded-hal`. This should include a link to the previous discussion issue.
3932

40-
The traits will undergo a testing period before they move into the set of proven traits. During
41-
this period users are encouraged to try to implement the unproven traits for their platforms and to
42-
build drivers on top of them. Problems implementing the trait(s) as well as successful
43-
implementations should be reported on the corresponding issue.
33+
If there is determined to be more than one alternative then there should be further discussion to
34+
try to single out the best option. Once there is consensus this will be merged into the `embedded-hal` repository.
4435

45-
To leave the unproven state at least *two* implementations of the trait(s) for different platforms
46-
(ideally, the two platforms should be from different vendors) and *one* generic driver built on top
47-
of the trait(s), or alternatively one demo program that exercises the trait (via generic function /
48-
trait object), *should* be demonstrated. If, instead, reports indicate that the proposed trait(s)
49-
can't be implemented for a certain platform then the trait(s) will be removed and we'll go back to
50-
the drawing board.
36+
These issues / PRs will be labeled as `proposal`s in the issue tracker.
5137

52-
Issues used to track unproven APIs will be labeled as `unproven-api`s in the issue tracker and they
53-
may also include the labels `needs-impl` and `needs-driver` to signal what's required for them to
54-
move to the set of proven traits.
5538

5639
## Implementations and drivers
5740

@@ -60,6 +43,11 @@ list.
6043

6144
[awesome-embedded-rust]: https://github.com/rust-embedded/awesome-embedded-rust#driver-crates
6245

46+
# Minimum Supported Rust Version (MSRV)
47+
48+
This crate is guaranteed to compile on stable Rust 1.35 and up. It *might*
49+
compile with older versions but that may change in any new patch release.
50+
6351
## License
6452

6553
Licensed under either of

ci/after_success.sh

-20
This file was deleted.

ci/install.sh

-10
This file was deleted.

ci/script.sh

-13
This file was deleted.

0 commit comments

Comments
 (0)