aboutsummaryrefslogtreecommitdiff
path: root/examples/preempt.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-08-21 10:53:13 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-08-21 10:53:13 +0200
commit7ca5bbf404330a7f92e94e3d4d8cdf0438e0e5c6 (patch)
tree47722e3d014c84f1b33d3b4eee09a84c42f11a7e /examples/preempt.rs
parent69729d78eb37420a55b1c96bab322d7952759bed (diff)
downloadrtic-7ca5bbf404330a7f92e94e3d4d8cdf0438e0e5c6.tar.gz
rtic-7ca5bbf404330a7f92e94e3d4d8cdf0438e0e5c6.tar.zst
rtic-7ca5bbf404330a7f92e94e3d4d8cdf0438e0e5c6.zip
fix preempt example
Diffstat (limited to 'examples/preempt.rs')
-rw-r--r--examples/preempt.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/preempt.rs b/examples/preempt.rs
index 9f1b2a5c..d7a7e644 100644
--- a/examples/preempt.rs
+++ b/examples/preempt.rs
@@ -12,26 +12,26 @@ use rtfm::app;
const APP: () = {
#[init]
fn init(_: init::Context) {
- rtfm::pend(Interrupt::UART0);
+ rtfm::pend(Interrupt::GPIOA);
}
- #[task(binds = UART0, priority = 1)]
- fn uart0(_: uart0::Context) {
- hprintln!("UART0 - start").unwrap();
- rtfm::pend(Interrupt::UART2);
- hprintln!("UART0 - end").unwrap();
+ #[task(binds = GPIOA, priority = 1)]
+ fn gpioa(_: gpioa::Context) {
+ hprintln!("GPIOA - start").unwrap();
+ rtfm::pend(Interrupt::GPIOC);
+ hprintln!("GPIOA - end").unwrap();
debug::exit(debug::EXIT_SUCCESS);
}
- #[task(binds = UART1, priority = 2)]
- fn uart1(_: uart1::Context) {
- hprintln!(" UART1").unwrap();
+ #[task(binds = GPIOB, priority = 2)]
+ fn gpiob(_: gpiob::Context) {
+ hprintln!(" GPIOB").unwrap();
}
- #[task(binds = UART2, priority = 2)]
- fn uart2(_: uart2::Context) {
- hprintln!(" UART2 - start").unwrap();
- rtfm::pend(Interrupt::UART1);
- hprintln!(" UART2 - end").unwrap();
+ #[task(binds = GPIOC, priority = 2)]
+ fn gpioc(_: gpioc::Context) {
+ hprintln!(" GPIOC - start").unwrap();
+ rtfm::pend(Interrupt::GPIOB);
+ hprintln!(" GPIOC - end").unwrap();
}
};