mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
apply deferred-init + box idiom to susres
This commit is contained in:
parent
79ecd62015
commit
95239eb05f
1 changed files with 6 additions and 4 deletions
|
|
@ -188,13 +188,14 @@ mod implementation {
|
|||
// Set EV_ENABLE, this starts pre-emption
|
||||
sr.os_timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0b1);
|
||||
|
||||
sr
|
||||
}
|
||||
pub fn init(&mut self) {
|
||||
xous::claim_interrupt(
|
||||
utra::susres::SUSRES_IRQ,
|
||||
susres_handler,
|
||||
(&mut sr) as *mut SusResHw as *mut usize,
|
||||
self as *mut SusResHw as *mut usize,
|
||||
).expect("couldn't claim IRQ");
|
||||
|
||||
sr
|
||||
}
|
||||
pub fn ignore_wfi(&mut self) {
|
||||
self.csr.wfo(utra::susres::WFI_OVERRIDE, 1);
|
||||
|
|
@ -557,7 +558,8 @@ static SHOULD_RESUME: AtomicBool = AtomicBool::new(false);
|
|||
fn main() -> ! {
|
||||
// Start the OS timer which is responsible for setting up preemption.
|
||||
// os_timer::init();
|
||||
let mut susres_hw = implementation::SusResHw::new();
|
||||
let mut susres_hw = Box::new(implementation::SusResHw::new());
|
||||
susres_hw.init();
|
||||
|
||||
log_server::init_wait().unwrap();
|
||||
// debugging note: it's actually easiest to debug using client-side hooks. Search for
|
||||
|
|
|
|||
Loading…
Reference in a new issue