mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
fix lifetime issue on irq handler binding
using scoping for feature flags is tricky. also this is like, all totally unsafe code.
This commit is contained in:
parent
760d64e17c
commit
547aac5056
1 changed files with 4 additions and 2 deletions
|
|
@ -170,6 +170,8 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
|
|||
let cid = xous::connect(sid).unwrap(); // self-connection always succeeds
|
||||
// register interrupt handler
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
let cam_irq; // this binding has to out-live the temporaries below
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
{
|
||||
let irq = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(utra::irqarray8::HW_IRQARRAY8_BASE),
|
||||
|
|
@ -181,9 +183,9 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
|
|||
let mut irq_csr = utralib::CSR::new(irq.as_mut_ptr() as *mut u32);
|
||||
irq_csr.wo(utra::irqarray8::EV_PENDING, 0xFFFF); // clear any pending interrupts
|
||||
|
||||
let cam_irq = CamIrq { csr: utralib::CSR::new(irq.as_mut_ptr() as *mut u32), cid };
|
||||
cam_irq = CamIrq { csr: utralib::CSR::new(irq.as_mut_ptr() as *mut u32), cid };
|
||||
let irq_arg = &cam_irq as *const CamIrq as *mut usize;
|
||||
log::debug!("irq_arg: {:x}", irq_arg as usize);
|
||||
log::info!("irq_arg: {:x}", irq_arg as usize);
|
||||
xous::claim_interrupt(utra::irqarray8::IRQARRAY8_IRQ, handle_irq, irq_arg)
|
||||
.expect("couldn't claim IRQ8");
|
||||
// enable camera Rx IRQ
|
||||
|
|
|
|||
Loading…
Reference in a new issue