mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
shell: use connect() instead of try_connect()
We don't need to use `try_connect()` anymore since we now have `connect()` which will automatically retry as necessary. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
222bde8db7
commit
e7aa2c70a0
1 changed files with 4 additions and 15 deletions
|
|
@ -44,9 +44,6 @@ impl Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(baremetal)]
|
||||
use utralib::generated::*;
|
||||
|
||||
fn move_lfsr(mut lfsr: u32) -> u32 {
|
||||
lfsr ^= lfsr >> 7;
|
||||
lfsr ^= lfsr << 9;
|
||||
|
|
@ -54,15 +51,6 @@ fn move_lfsr(mut lfsr: u32) -> u32 {
|
|||
lfsr
|
||||
}
|
||||
|
||||
fn ensure_connection(server: xous::SID) -> xous::CID {
|
||||
loop {
|
||||
if let Ok(cid) = xous::syscall::try_connect(server) {
|
||||
return cid;
|
||||
}
|
||||
xous::syscall::yield_slice();
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Bounce {
|
||||
vector: Point,
|
||||
radius: u16,
|
||||
|
|
@ -136,9 +124,9 @@ fn shell_main() -> ! {
|
|||
let log_server_id = xous::SID::from_bytes(b"xous-log-server ").unwrap();
|
||||
|
||||
println!("SHELL: Attempting to connect to servers...");
|
||||
let log_conn = ensure_connection(log_server_id);
|
||||
let graphics_conn = ensure_connection(graphics_server_id);
|
||||
let ticktimer_conn = ensure_connection(ticktimer_server_id);
|
||||
let log_conn = xous::connect(log_server_id).unwrap();
|
||||
let graphics_conn = xous::connect(graphics_server_id).unwrap();
|
||||
let ticktimer_conn = xous::connect(ticktimer_server_id).unwrap();
|
||||
|
||||
println!(
|
||||
"SHELL: Connected to Log server: {} Graphics server: {} Ticktimer server: {}",
|
||||
|
|
@ -168,6 +156,7 @@ fn shell_main() -> ! {
|
|||
|
||||
#[cfg(baremetal)]
|
||||
{
|
||||
use utralib::generated::*;
|
||||
let gpio_base = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(utra::gpio::HW_GPIO_BASE),
|
||||
None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue