fix set_handler context

This commit is contained in:
xoviat 2021-01-06 10:49:08 -06:00
parent 61a7cf5c3d
commit 66622de82a

View File

@ -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);