mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
examples: shell: adapt to new form of syscalls
We're not slinging raw pointers around anymore. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
8cc43d64b5
commit
6ad48ab062
1 changed files with 7 additions and 5 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
use xous::{MemorySize, MemoryAddress};
|
||||||
|
|
||||||
const SYSTEM_CLOCK_FREQUENCY: u32 = 12_000_000;
|
const SYSTEM_CLOCK_FREQUENCY: u32 = 12_000_000;
|
||||||
const TIMER_BASE: usize = 0xF000_3000;
|
const TIMER_BASE: usize = 0xF000_3000;
|
||||||
|
|
||||||
|
|
@ -15,17 +17,17 @@ fn timer_tick(_irq_no: usize, _arg: *mut usize) {
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
println!("Allocating timer...");
|
println!("Allocating timer...");
|
||||||
xous::rsyscall(xous::SysCall::MapMemory(
|
xous::rsyscall(xous::SysCall::MapMemory(
|
||||||
TIMER_BASE as *mut usize,
|
MemoryAddress::new(TIMER_BASE),
|
||||||
TIMER_BASE as *mut usize,
|
MemoryAddress::new(TIMER_BASE),
|
||||||
4096,
|
MemorySize::new(4096).unwrap(),
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
))
|
))
|
||||||
.expect("timer: couldn't map timer");
|
.expect("timer: couldn't map timer");
|
||||||
|
|
||||||
xous::rsyscall(xous::SysCall::ClaimInterrupt(
|
xous::rsyscall(xous::SysCall::ClaimInterrupt(
|
||||||
1,
|
1,
|
||||||
timer_tick as *mut usize,
|
MemoryAddress::new(timer_tick as *mut usize as usize).unwrap(),
|
||||||
core::ptr::null_mut::<usize>(),
|
None,
|
||||||
))
|
))
|
||||||
.expect("timer: couldn't claim interrupt");
|
.expect("timer: couldn't claim interrupt");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue