Skip to content

Commit

Permalink
add hello example, update to use upstream repos
Browse files Browse the repository at this point in the history
  • Loading branch information
evq committed Nov 4, 2018
1 parent adb2d8d commit 7021b27
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ vcell = "0.1.0"

[dependencies.cortex-m]
git = "https://github.com/rust-embedded/cortex-m"
rev = "b70a2179f4e8ee7908b61a6a97970e0cfcf2f313"

[dependencies.cortex-m-rt]
git = "https://github.com/evq/cortex-m-rt"
branch = "thumbv8m.base"
git = "https://github.com/rust-embedded/cortex-m-rt"
rev = "9cd01176a6a9985c9bc0040801ed593687dd6ab1"
optional = true

[dev-dependencies.cortex-m-rt]
git = "https://github.com/evq/cortex-m-rt"
branch = "thumbv8m.base"
git = "https://github.com/rust-embedded/cortex-m-rt"
rev = "9cd01176a6a9985c9bc0040801ed593687dd6ab1"

[dev-dependencies.cortex-m-semihosting]
git = "https://github.com/rust-embedded/cortex-m-semihosting"
rev = "471378bc848172e12e22b9a3b83190747e70bf5c"

[dev-dependencies.panic-semihosting]
git = "https://github.com/evq/panic-semihosting"
rev = "3d7041af24969f32606e5eb804e23eaac7fb0bfa"

[features]
rt = ["cortex-m-rt/device"]
Expand Down
28 changes: 28 additions & 0 deletions examples/hello.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#![no_main]
#![no_std]
extern crate atsaml11xxx;

extern crate cortex_m;
extern crate cortex_m_rt;
// makes `panic!` print messages to the host stderr using semihosting
extern crate panic_semihosting;

extern crate cortex_m_semihosting;

use core::fmt::Write;

use cortex_m_rt::entry;
use cortex_m_semihosting::hio;

// use `main` as the entry point of this application
// `main` is not allowed to return
#[entry]
fn main() -> ! {
let mut stdout = hio::hstdout().unwrap();

let language = "Rust";
let ranking = 1;

write!(stdout, "{} on embedded is #{}!", language, ranking);
loop {}
}

0 comments on commit 7021b27

Please sign in to comment.