Skip to content

Commit

Permalink
fixup: address review comments
Browse files Browse the repository at this point in the history
Address review comments by @andre-richter: proof-reading

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
  • Loading branch information
geomatsi committed Jul 11, 2019
1 parent 18557e7 commit 314a00b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/concurrency/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ Since we can't move the `GPIOA` out of the `&Option`, we need to convert it to
an `&Option<&GPIOA>` with `as_ref()`, which we can finally `unwrap()` to obtain
the `&GPIOA` which lets us modify the peripheral.

If we need a mutable reference to shared resource, then `borrow_mut` and `deref_mut`
should be used instead. The following example makes use of mutable reference TIM2 timer.
If we need a mutable references to shared resources, then `borrow_mut` and `deref_mut`
should be used instead. The following code shows an example using the TIM2 timer.

```rust,ignore
use core::cell::RefCell;
Expand All @@ -531,7 +531,7 @@ fn main() -> ! {
let dp = stm32f405::Peripherals::take().unwrap();
// Some sort of timer configuration function.
// Assume it configures TIM2 timer, its NVIC interrupt,
// Assume it configures the TIM2 timer, its NVIC interrupt,
// and finally starts the timer.
let tim = configure_timer_interrupt(&mut cp, dp);
Expand All @@ -557,19 +557,19 @@ fn timer() {

> **NOTE**
>
> At the moment `cortex-m` crate hides const versions of some functions
> (including `Mutex::new()`) behind the `const-fn` feature. So you need to add
> the `const-fn` feature to dependency on cortex-m in Cargo.toml to make
> At the moment, the `cortex-m` crate hides const versions of some functions
> (including `Mutex::new()`) behind the `const-fn` feature. So you need to add
> the `const-fn` feature as a dependency for cortex-m in the Cargo.toml to make
> the above examples work:
>
> ``` toml
> [dependencies.cortex-m]
> version="0.6.0"
> features=["const-fn"]
> ```
> Meanwhile `const-fn` has been working on stable Rust for some time now.
> Meanwhile, `const-fn` has been working on stable Rust for some time now.
> So this additional switch in Cargo.toml will not be needed as soon as
> it is enabled in `cortex-m` by defauilt.
> it is enabled in `cortex-m` by default.
>
Whew! This is safe, but it is also a little unwieldy. Is there anything else
Expand Down

0 comments on commit 314a00b

Please sign in to comment.