aboutsummaryrefslogtreecommitdiff
path: root/examples/binds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/binds.rs')
-rw-r--r--examples/binds.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/examples/binds.rs b/examples/binds.rs
index a8b386fb..42010ae2 100644
--- a/examples/binds.rs
+++ b/examples/binds.rs
@@ -5,35 +5,37 @@
#![no_main]
#![no_std]
-extern crate panic_semihosting;
-
use cortex_m_semihosting::{debug, hprintln};
use lm3s6965::Interrupt;
-use rtfm::app;
+use panic_semihosting as _;
// `examples/interrupt.rs` rewritten to use `binds`
-#[app(device = lm3s6965)]
-const APP: () = {
+#[rtic::app(device = lm3s6965)]
+mod app {
#[init]
- fn init() {
- rtfm::pend(Interrupt::UART0);
+ fn init(_: init::Context) -> init::LateResources {
+ rtic::pend(Interrupt::UART0);
hprintln!("init").unwrap();
+
+ init::LateResources {}
}
#[idle]
- fn idle() -> ! {
+ fn idle(_: idle::Context) -> ! {
hprintln!("idle").unwrap();
- rtfm::pend(Interrupt::UART0);
+ rtic::pend(Interrupt::UART0);
debug::exit(debug::EXIT_SUCCESS);
- loop {}
+ loop {
+ cortex_m::asm::nop();
+ }
}
- #[interrupt(binds = UART0)]
- fn foo() {
+ #[task(binds = UART0)]
+ fn foo(_: foo::Context) {
static mut TIMES: u32 = 0;
*TIMES += 1;
@@ -45,4 +47,4 @@ const APP: () = {
)
.unwrap();
}
-};
+}