Merge pull request #16 from xoviat/fix-interrupts
fix set_handler context
This commit is contained in:
commit
896eb0ed52
1 changed files with 6 additions and 6 deletions
|
@ -88,9 +88,9 @@ impl Serial<USART1, Stream7<DMA2>, Stream2<DMA2>> {
|
||||||
let (usart, _) = serial.release();
|
let (usart, _) = serial.release();
|
||||||
|
|
||||||
// Register ISR
|
// Register ISR
|
||||||
tx_int.set_handler(Self::on_tx_irq);
|
tx_int.set_handler(Self::on_tx_irq, core::ptr::null_mut());
|
||||||
rx_int.set_handler(Self::on_rx_irq);
|
rx_int.set_handler(Self::on_rx_irq, core::ptr::null_mut());
|
||||||
usart_int.set_handler(Self::on_rx_irq);
|
usart_int.set_handler(Self::on_rx_irq, core::ptr::null_mut());
|
||||||
// usart_int.unpend();
|
// usart_int.unpend();
|
||||||
// usart_int.enable();
|
// usart_int.enable();
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ impl Serial<USART1, Stream7<DMA2>, Stream2<DMA2>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn on_tx_irq() {
|
unsafe fn on_tx_irq(_ctx: *mut ()) {
|
||||||
let s = &(*INSTANCE);
|
let s = &(*INSTANCE);
|
||||||
|
|
||||||
s.tx_int.disable();
|
s.tx_int.disable();
|
||||||
|
@ -114,7 +114,7 @@ impl Serial<USART1, Stream7<DMA2>, Stream2<DMA2>> {
|
||||||
STATE.tx_int.signal(());
|
STATE.tx_int.signal(());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn on_rx_irq() {
|
unsafe fn on_rx_irq(_ctx: *mut ()) {
|
||||||
let s = &(*INSTANCE);
|
let s = &(*INSTANCE);
|
||||||
|
|
||||||
atomic::compiler_fence(Ordering::Acquire);
|
atomic::compiler_fence(Ordering::Acquire);
|
||||||
|
@ -125,7 +125,7 @@ impl Serial<USART1, Stream7<DMA2>, Stream2<DMA2>> {
|
||||||
STATE.rx_int.signal(());
|
STATE.rx_int.signal(());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn on_usart_irq() {
|
unsafe fn on_usart_irq(_ctx: *mut ()) {
|
||||||
let s = &(*INSTANCE);
|
let s = &(*INSTANCE);
|
||||||
|
|
||||||
atomic::compiler_fence(Ordering::Acquire);
|
atomic::compiler_fence(Ordering::Acquire);
|
||||||
|
|
Loading…
Reference in a new issue