mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +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 {
|
fn move_lfsr(mut lfsr: u32) -> u32 {
|
||||||
lfsr ^= lfsr >> 7;
|
lfsr ^= lfsr >> 7;
|
||||||
lfsr ^= lfsr << 9;
|
lfsr ^= lfsr << 9;
|
||||||
|
|
@ -54,15 +51,6 @@ fn move_lfsr(mut lfsr: u32) -> u32 {
|
||||||
lfsr
|
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 {
|
pub struct Bounce {
|
||||||
vector: Point,
|
vector: Point,
|
||||||
radius: u16,
|
radius: u16,
|
||||||
|
|
@ -136,9 +124,9 @@ fn shell_main() -> ! {
|
||||||
let log_server_id = xous::SID::from_bytes(b"xous-log-server ").unwrap();
|
let log_server_id = xous::SID::from_bytes(b"xous-log-server ").unwrap();
|
||||||
|
|
||||||
println!("SHELL: Attempting to connect to servers...");
|
println!("SHELL: Attempting to connect to servers...");
|
||||||
let log_conn = ensure_connection(log_server_id);
|
let log_conn = xous::connect(log_server_id).unwrap();
|
||||||
let graphics_conn = ensure_connection(graphics_server_id);
|
let graphics_conn = xous::connect(graphics_server_id).unwrap();
|
||||||
let ticktimer_conn = ensure_connection(ticktimer_server_id);
|
let ticktimer_conn = xous::connect(ticktimer_server_id).unwrap();
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"SHELL: Connected to Log server: {} Graphics server: {} Ticktimer server: {}",
|
"SHELL: Connected to Log server: {} Graphics server: {} Ticktimer server: {}",
|
||||||
|
|
@ -168,6 +156,7 @@ fn shell_main() -> ! {
|
||||||
|
|
||||||
#[cfg(baremetal)]
|
#[cfg(baremetal)]
|
||||||
{
|
{
|
||||||
|
use utralib::generated::*;
|
||||||
let gpio_base = xous::syscall::map_memory(
|
let gpio_base = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(utra::gpio::HW_GPIO_BASE),
|
xous::MemoryAddress::new(utra::gpio::HW_GPIO_BASE),
|
||||||
None,
|
None,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue