Skip to content
Snippets Groups Projects
Commit 421a0557 authored by Per's avatar Per
Browse files

loopback update

parent 1ae55852
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,10 @@ app! {
path: error_usart_overflow,
priority: 1,
},
EXTI4: {
path: rxne_not_set,
priority: 1,
},
}
}
......@@ -104,16 +108,19 @@ fn usart2_handler(_t: &mut Threshold, r: USART2::Resources) {
r.USART2.dr.read(); // clear the error by reading the data register
}
}
}
match r.SEND.dequeue() {
Some(b) => {
// we (still) have something in the queue to send
let _ = serial.write(b);
}
_ => {
// the que was empty so the last item was already sent
serial.unlisten(Event::Txe);
} else {
// rxne not set
rtfm::set_pending(f4::stm32f40x::Interrupt::EXTI4);
match r.SEND.dequeue() {
Some(b) => {
// we (still) have something in the queue to send
let _ = serial.write(b);
}
_ => {
// the que was empty so the last item was already sent
serial.unlisten(Event::Txe);
}
}
}
}
......@@ -161,6 +168,10 @@ fn error_usart_overflow() {
ipln!("error_usart_overflow");
}
fn rxne_not_set() {
ip!("-");
}
#[derive(Debug)]
enum Command {
Start,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment