mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
update the skeleton to the more recent practices
This commit is contained in:
parent
d49c35dc0c
commit
bc55e7db5f
1 changed files with 5 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
#![cfg_attr(target_os = "none", no_std)]
|
#![cfg_attr(target_os = "none", no_std)]
|
||||||
|
|
||||||
pub mod api;
|
pub mod api;
|
||||||
|
pub use api::*;
|
||||||
use xous::{CID, send_message};
|
use xous::{CID, send_message};
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
|
|
||||||
|
|
@ -8,12 +9,13 @@ pub struct Codec {
|
||||||
conn: CID,
|
conn: CID,
|
||||||
}
|
}
|
||||||
impl Codec {
|
impl Codec {
|
||||||
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new() -> Self {
|
||||||
|
let xns = xous_names::XousNames::new().expect("couldn't connect to XousNames");
|
||||||
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
let conn = xns.request_connection_blocking(api::SERVER_NAME_CODEC).expect("Can't connect to Codec server");
|
let conn = xns.request_connection_blocking(api::SERVER_NAME_CODEC).expect("Can't connect to Codec server");
|
||||||
Ok(Codec {
|
Codec {
|
||||||
conn
|
conn
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue