mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +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
|
// Set EV_ENABLE, this starts pre-emption
|
||||||
sr.os_timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0b1);
|
sr.os_timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0b1);
|
||||||
|
|
||||||
|
sr
|
||||||
|
}
|
||||||
|
pub fn init(&mut self) {
|
||||||
xous::claim_interrupt(
|
xous::claim_interrupt(
|
||||||
utra::susres::SUSRES_IRQ,
|
utra::susres::SUSRES_IRQ,
|
||||||
susres_handler,
|
susres_handler,
|
||||||
(&mut sr) as *mut SusResHw as *mut usize,
|
self as *mut SusResHw as *mut usize,
|
||||||
).expect("couldn't claim IRQ");
|
).expect("couldn't claim IRQ");
|
||||||
|
|
||||||
sr
|
|
||||||
}
|
}
|
||||||
pub fn ignore_wfi(&mut self) {
|
pub fn ignore_wfi(&mut self) {
|
||||||
self.csr.wfo(utra::susres::WFI_OVERRIDE, 1);
|
self.csr.wfo(utra::susres::WFI_OVERRIDE, 1);
|
||||||
|
|
@ -557,7 +558,8 @@ static SHOULD_RESUME: AtomicBool = AtomicBool::new(false);
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
// Start the OS timer which is responsible for setting up preemption.
|
// Start the OS timer which is responsible for setting up preemption.
|
||||||
// os_timer::init();
|
// 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();
|
log_server::init_wait().unwrap();
|
||||||
// debugging note: it's actually easiest to debug using client-side hooks. Search for
|
// debugging note: it's actually easiest to debug using client-side hooks. Search for
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue