turn into a Cargo crate
This commit is contained in:
28
src/examples/_0_hello.rs
Normal file
28
src/examples/_0_hello.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
//! Prints "Hello, world!" on the OpenOCD console using semihosting
|
||||
//!
|
||||
//! ```
|
||||
//!
|
||||
//! #![feature(used)]
|
||||
//! #![no_std]
|
||||
//!
|
||||
//! #[macro_use]
|
||||
//! extern crate cortex_m;
|
||||
//! extern crate cortex_m_rt;
|
||||
//!
|
||||
//! use cortex_m::asm;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! hprintln!("Hello, world!");
|
||||
//! }
|
||||
//!
|
||||
//! // As we are not using interrupts, we just register a dummy catch all handler
|
||||
//! #[allow(dead_code)]
|
||||
//! #[used]
|
||||
//! #[link_section = ".rodata.interrupts"]
|
||||
//! static INTERRUPTS: [extern "C" fn(); 240] = [default_handler; 240];
|
||||
//!
|
||||
//! extern "C" fn default_handler() {
|
||||
//! asm::bkpt();
|
||||
//! }
|
||||
//! ```
|
||||
// Auto-generated. Do not modify.
|
||||
Reference in New Issue
Block a user