minor cleanup in this crate, although, a much larger cleanup is coming

we're going to strip out the USB cramium support from this crate
eventually because it has migrated to a stand-alone crate

the hardware model is just too different to keep the two branches
in sync: one allows interrupts to be delegated to userspace, the other
requires the interrupts to happen all in the locked handler context
due to timing assumptions of the core.

the problem with the interrupt handler context is that panics
are really hard to debug - you can't actually send a panic message
from an interrupt context, because there is no IPC when the
handler is running. Normally we try to keep the handlers as
minimal as possible, but in this case we can't due to hardware
assumptions.
This commit is contained in:
bunnie 2024-12-23 01:19:21 +08:00
parent 5aac426b0b
commit 568a15dc4f

View file

@ -246,7 +246,7 @@ pub(crate) fn main_hw() -> ! {
// safety: this is safe because we allocated ifram_range to have the same physical and virtual addresses
#[cfg(feature = "cramium-soc")]
let usbwrapper = CorigineWrapper::new(unsafe {
let mut cu = CorigineUsb::new(cid, h_op, ifram_range.as_ptr() as usize, usb.clone(), irq_csr.clone());
let mut cu = CorigineUsb::new(ifram_range.as_ptr() as usize, usb.clone(), irq_csr.clone());
// assign the default handler, since this is the std case
cu.assign_handler(cramium_hal::usb::driver::handle_event);
cu