forked from evq/atsaml11xxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add hello example, update to use upstream repos
- Loading branch information
Showing
2 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
} |