Merge pull request #4 from mogenson/master
Fixup Getting Started -> Building page
This commit is contained in:
@@ -116,7 +116,7 @@ If you have forgotten how to do this, try looking at [the cargo book][cargo].
|
||||
``` rust
|
||||
#![no_std]
|
||||
|
||||
extern crate panic_abort;
|
||||
extern crate panic_halt;
|
||||
|
||||
fn main() {
|
||||
}
|
||||
@@ -141,8 +141,8 @@ neither the crt0 nor the rust runtime are available,
|
||||
so even implementing `start` would not help us.
|
||||
We need to replace the operating system entry point.
|
||||
|
||||
You could for example name a function after the default entry point,
|
||||
which for linux is `_start`, and start that way.
|
||||
You could for example name a function after the default entry point,
|
||||
which for linux is `_start`, and start that way.
|
||||
Note, you would also need to disable [name mangling][nm]:
|
||||
|
||||
``` rust
|
||||
@@ -232,15 +232,15 @@ and cargo will automatically add `--target thumbv6m-none-eabi`.
|
||||
|
||||
### `src/main.rs`
|
||||
|
||||
``` rust
|
||||
``` rust
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate panic_abort;
|
||||
extern crate panic_halt;
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
|
||||
#[entry];
|
||||
#[entry]
|
||||
fn main() {
|
||||
}
|
||||
```
|
||||
@@ -271,7 +271,7 @@ An easy way to implement this is to use an infinite loop.
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate panic_abort;
|
||||
extern crate panic_halt;
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ name = "start"
|
||||
version = "0.2.0"
|
||||
|
||||
[dependencies]
|
||||
panic-abort = "~0.3"
|
||||
microbit="~0.6"
|
||||
panic-halt = "~0.2"
|
||||
microbit="~0.7"
|
||||
cortex-m-rt="~0.6"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
extern crate cortex_m_rt;
|
||||
extern crate microbit;
|
||||
extern crate panic_abort;
|
||||
extern crate panic_halt;
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user