Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peripherals as scoped singletons #158

Merged
merged 7 commits into from
Dec 9, 2017
Merged

Peripherals as scoped singletons #158

merged 7 commits into from
Dec 9, 2017

Conversation

japaric
Copy link
Member

@japaric japaric commented Nov 21, 2017

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

  • accept the RFC
  • Check that non cortex-m targets still work postponed
  • decide on better names for Peripherals::{all,_all}

@japaric
Copy link
Member Author

japaric commented Nov 26, 2017

Regarding names, how about Peripherals::take for the safe -> Option<Self> version since it resembles the Option.take method. And maybe ... Peripherals::steal for the unsafe version, since it's unchecked? Another option for the latter could be take_unchecked or something with "unchecked" word in it.

@japaric japaric changed the title [WIP] Peripherals as scoped singletons Peripherals as scoped singletons Dec 9, 2017
@japaric
Copy link
Member Author

japaric commented Dec 9, 2017

Regarding names, ...

I'm going ahead with take and steal.

Check that non cortex-m targets still work

I'm going to defer this until right before the actual release

@homunkulus r+

@homunkulus
Copy link
Contributor

📌 Commit e114878 has been approved by japaric

@homunkulus
Copy link
Contributor

⌛ Testing commit e114878 with merge a2a9b72...

japaric pushed a commit that referenced this pull request Dec 9, 2017
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}`
@japaric
Copy link
Member Author

japaric commented Dec 9, 2017

@homunkulus r+

@homunkulus
Copy link
Contributor

📌 Commit 56cd979 has been approved by japaric

@homunkulus
Copy link
Contributor

⌛ Testing commit 56cd979 with merge 5b0bf79...

japaric pushed a commit that referenced this pull request Dec 9, 2017
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}`
@homunkulus
Copy link
Contributor

💔 Test failed - status-travis

@japaric
Copy link
Member Author

japaric commented Dec 9, 2017

@homunkulus r+

@homunkulus
Copy link
Contributor

📌 Commit 9c2ec7b has been approved by japaric

@homunkulus
Copy link
Contributor

⌛ Testing commit 9c2ec7b with merge 26c2ef9...

japaric pushed a commit that referenced this pull request Dec 9, 2017
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}`
japaric pushed a commit to rtic-rs/rtic that referenced this pull request Dec 9, 2017
Peripherals as scoped singletons

See this RFC for details: rust-embedded/svd2rust#157

- The first commit adapts this crate to the changes in rust-embedded/cortex-m#65 and rust-embedded/svd2rust#158
- ~~The second commit is an alternative implementation of RFC #47 (there's another implementation in #49. This second commit is not required for RFC157 but let us experiment with safe DMA abstractions.~~ postponed

### TODO

- [x] un-bless peripherals as resources. Peripherals as resources were special cased: if resource listed in e.g. `app.tasks.FOO.resources` didn't appear in `app.resources` then it was assumed to be a peripheral and special code was generated for it. This is no longer required under RFC157.

~~This depends on PR rtic-rs/rtic-syntax#2~~ postponed
@japaric
Copy link
Member Author

japaric commented Dec 9, 2017

@homunkulus r+

@homunkulus
Copy link
Contributor

📌 Commit 3b27815 has been approved by japaric

@homunkulus
Copy link
Contributor

⌛ Testing commit 3b27815 with merge 227a0b1...

japaric pushed a commit that referenced this pull request Dec 9, 2017
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}`
@homunkulus
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: japaric
Pushing 227a0b1 to master...

@hannobraun
Copy link
Member

Regarding names, ...

I'm going ahead with take and steal.

I like those! Short and to the point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants