283 Commits

Author SHA1 Message Date
Roberto Vidal
cec15cc453 Fixes outdated links to docs 2018-12-13 15:42:06 +01:00
Roberto Vidal
06b53fdf7b Fixes dead bindgen link 2018-12-13 13:34:55 +01:00
Jorge Aparicio
388ee46c85 remove "this section is WIP" from the getting started intro page
this section is largely done and the linked issue has already been closed
2018-12-04 23:34:40 +01:00
Adam Greig
dd9c517d5d c-tips: fix concurrency typo 2018-12-03 10:12:09 +00:00
Adam Greig
316530dc99 c-tips: fix concurrency chapter link 2018-12-03 10:03:05 +00:00
Adam Greig
2038e2657a c-tips: formatting and fix whitespace 2018-12-02 23:04:25 +00:00
Adam Greig
fe0c555e00 c-tips: format other resources list better 2018-12-02 23:02:12 +00:00
Adam Greig
a89b485051 c-tips: mention volatile 2018-12-02 23:02:12 +00:00
Emil Fresk
ea1c087dd0 Update src/c-tips/c-tips.md
Co-Authored-By: adamgreig <adam@adamgreig.com>
2018-12-02 23:02:12 +00:00
Emil Fresk
9e2b9a7256 Update src/c-tips/c-tips.md
Co-Authored-By: adamgreig <adam@adamgreig.com>
2018-12-02 23:02:12 +00:00
Adam Greig
955708d6ea Detail use of repr 2018-12-02 23:02:12 +00:00
Adam Greig
52a01b6f53 Mention target_arch conditional compilation 2018-12-02 23:02:12 +00:00
Adam Greig
6e8271ea5c Updates to address comments in PR 2018-12-02 23:02:12 +00:00
Emil Fresk
770cbceab2 Update src/c-tips/c-tips.md
Co-Authored-By: adamgreig <adam@adamgreig.com>
2018-12-02 23:02:12 +00:00
Emil Fresk
1674b11fb5 Update src/c-tips/c-tips.md
Co-Authored-By: adamgreig <adam@adamgreig.com>
2018-12-02 23:02:12 +00:00
Daniel Egger
a79918f1d0 Update src/c-tips/c-tips.md
Co-Authored-By: adamgreig <adam@adamgreig.com>
2018-12-02 23:02:12 +00:00
Adam Greig
12eb5b96af First draft of c-tips 2018-12-02 23:02:12 +00:00
Nathan
d2bc7a6951 Remove duplicate "and" 2018-11-23 20:30:21 -08:00
Nathan
84e5976fed Consistency: initialised->initialized 2018-11-23 20:30:21 -08:00
Nathan
169f59eb7c Typo intialise->initialize 2018-11-23 20:30:20 -08:00
Nathan
f85a8df4fa Typos: temperatur, arays, actors, relais -> temperature, arrays,
actuators, relays
2018-11-23 20:30:20 -08:00
Nathan
20d9a21d13 Typo intialise->initialize 2018-11-23 20:29:04 -08:00
Nathan
bf13a6db68 Typo: defintely->definitely 2018-11-23 20:27:35 -08:00
Nathan
68fb2ba5b5 Typo whch->which 2018-11-23 20:27:35 -08:00
Nathan
4fe0ff4ec1 Refactor and generalize
- to avoid repetitive statements
2018-11-23 20:27:35 -08:00
Nathan
290fb34964 Refactor a sentence. 2018-11-23 20:27:35 -08:00
Nathan
6a37fe713e Fix set_output_status -> set_output_mode 2018-11-23 20:27:35 -08:00
Nathan
b8f78902b1 Add emphasis, fix grammar 2018-11-23 20:27:35 -08:00
Nathan
aea542b019 No newline at end of file? 2018-11-23 20:27:35 -08:00
bors[bot]
65da0fcb5c Merge #92
92: static-guarantees: add intro text r=jamesmunns a=japaric

cc @jamesmunns

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-11-20 09:26:03 +00:00
bors[bot]
a207acb000 Merge #87
87: Have mdBook not wrap code snippets in "fn main() {}" r=therealprof a=adamgreen

This is the same change as in commit c5caa3b but for the instances I noticed in the rest of the chapters.

Before this change, clicking on the icon to copy a code snippet to the clipboard would result in something like:
```rust
fn main() {
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
}
```
After this change, the following would be copied to the clipboard instead:
```rust
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
```

Co-authored-by: Adam Green <adamgreen@users.noreply.github.com>
2018-11-20 08:32:53 +00:00
Jorge Aparicio
03baf55633 static-guarantees: add intro text 2018-11-20 00:27:43 +01:00
Adam Green
e55d4c936f Make transmitter example plural
I switched to using 'transmitter' as an example in my a1c7244 commit
last night when the rest of the examples were plural. This commit adds
the 's' to make it consistent with the other examples.
2018-11-19 11:02:42 -08:00
bors[bot]
5b0e8a1292 Merge #90
90: Move "last_state = state" assignment r=adamgreig a=adamgreen

I believe that I have found a bug in the samples found in the concurrency chapter where the value of the `last_state` variable should be updated on each loop iteration but it is only updated on the detection of the first leading edge. For example:

```rust
    loop {
        let state = read_signal_level();
        if state && !last_state {
            last_state = state;
            // DANGER - Not actually safe! Could cause data races.
            unsafe { COUNTER += 1 };
        }
    }
```

I think that loop should actually be written as:
```rust
    loop {
        let state = read_signal_level();
        if state && !last_state {
            // DANGER - Not actually safe! Could cause data races.
            unsafe { COUNTER += 1 };
        }
        last_state = state;
    }
```

As the code exists today, I think it would detect the first leading edge, set last_state to true and then never be updated again which would also mean that it never detects another leading edge.

Co-authored-by: Adam Green <adamgreen@users.noreply.github.com>
2018-11-19 10:26:58 +00:00
Adam Green
a1c7244548 Few typo fixes
I fixed a few more typos I noticed as I finished my first read through
of the Embedded Rust Book.

My editor also deleted some trailing white space from a few lines when
I saved out my typo fixes.
2018-11-19 01:53:03 -08:00
Adam Green
255c2b57b2 Move "last_state = state" assignment
I believe that I have found a bug in the samples found in the
concurrency chapter where the value of the `last_state` variable
should be updated on each loop iteration but it is only updated
on the detection of the first leading edge. For example:

    loop {
        let state = read_signal_level();
        if state && !last_state {
            last_state = state;
            // DANGER - Not actually safe! Could cause data races.
            unsafe { COUNTER += 1 };
        }
    }

I think that loop should actually be written as:

    loop {
        let state = read_signal_level();
        if state && !last_state {
            // DANGER - Not actually safe! Could cause data races.
            unsafe { COUNTER += 1 };
        }
        last_state = state;
    }

As the code exists today, I think it would detect the first leading
edge, set last_state to true and then never be updated again which
would also mean that it never detects another leading edge.
2018-11-19 01:31:38 -08:00
bors[bot]
6a7b4037ed Merge #83
83: Mention complexity benefits by using embedded-hal r=jamesmunns a=therealprof



Co-authored-by: Daniel Egger <daniel@eggers-club.de>
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2018-11-18 17:14:16 +00:00
Emil Fresk
38188af8fa Update src/portability/index.md
Co-Authored-By: therealprof <daniel@eggers-club.de>
2018-11-18 18:07:39 +01:00
bors[bot]
863447366b Merge #84
84: Added layer diagram for embedded-hal use r=jamesmunns a=therealprof

Signed-off-by: Daniel Egger <daniel@eggers-club.de>

Co-authored-by: Daniel Egger <daniel@eggers-club.de>
2018-11-18 11:17:33 +00:00
Adam Green
97657c46c5 Fix typos in chapter in chapter 4 2018-11-18 00:19:51 -08:00
Adam Green
a4b7700871 Change 'thread' to 'process'
Section 3 discusses how the MMU on desktop machines is used to protect
one **thread** from accessing the memory of another thread. On most
desktop operating systems, the MMU is used to protect one **process**
from accessing another process' memory. Threads within a process can
typically access the memory used by other threads in the same process.
2018-11-18 00:10:35 -08:00
Adam Green
6e9007e144 Have mdBook not wrap code snippets in "fn main() {}"
This is the same change as in commit c5caa3b but for the instances I
noticed in the rest of the chapters.

Before this change, clicking on the icon to copy the code snippet to
the clipboard would result in:
```rust
fn main() {
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
}
```
After this change, the following is copied to the clipboard instead:
```rust
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
```
2018-11-17 23:54:10 -08:00
bors[bot]
482d412a92 Merge #86
86: Chapter 2 updates r=therealprof a=adamgreen

This PR includes a few chapter 2 updates:

* Have mdBook not wrap code snippets in "fn main() {}" by setting language to "rust,ignore".
For example before the following would be copied to the clipboard:
```rust
fn main() {
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
}
```
After this change, the following is copied to the clipboard:
```rust
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
```

* I also fixed some code samples so that they compile without errors/warnings. The biggest change was to a SysTick sample in the "Memory Mapped Registers" section to properly setup the SysTick peripheral to countdown 1000 ticks.
* Some minor text updates.

Co-authored-by: Adam Green <adamgreen@users.noreply.github.com>
2018-11-17 15:38:38 +00:00
Adam Green
98dbe9989b Chapter 2 code sample fixes
These fixes get code samples to compile without warnings. Other changes
include:
* Fix the SysTick code snippet on the "Memory Mapped Registers" page so
  that it:
  * Compiles without errors/warnings.
  * Sets up the SysTick peripheral correctly for counting down 1000
    ticks.
* Added a reminder in the "Semihosting" section about how to enable
  semihosting in openOCD.
2018-11-17 00:07:51 -08:00
Adam Green
c5caa3b72d Have mdBook not wrap code snippets in "fn main() {}"
I noticed that when I tried to copy a code snippet into the clipboard
that it had some extra code text that I didn't see on the webpage. It
had wrapped the code snippet in a "fn main()" declaration. The code
window on the page also contained arrows in the upper-right corner for
expanding the code so that this hidden declaration could be seen. These
snippets aren't meant to be working samples so treating them as code to
be contained in main() often doesn't make sense. Changing the language
from "rust" to "rust,ignore" on these snippets causes mdBook to not
perform this wrapping.

For example before the following would be copied to clipboard:
```rust
fn main() {
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
}
```

After this change, we get the following copied to the clipboard:
```rust
// Exception handler for the SysTick (System Timer) exception
fn SysTick() {
    // ..
}
```
2018-11-16 23:44:23 -08:00
Adam Green
20b30525b0 A few minor updates to Chapter 2 text 2018-11-16 23:36:46 -08:00
Adam Green
0092d74c7b Add '#' to URLs when appropriate anchors exist on page
For example there is a udev-rules anchor on the linux.md page so that
clicking on a [udev rules] link can jump to that specifc part of the
page.
2018-11-16 22:58:36 -08:00
Adam Green
01327046e3 A few fixes to chapter 1 2018-11-16 22:15:40 -08:00
Daniel Egger
22025eadef Added layer diagram for embedded-hal use
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2018-11-16 15:47:32 +01:00
Daniel Egger
268a76be63 Mention complexity benefits by using embedded-hal 2018-11-14 23:26:14 +01:00