Browse Source

Add basic Ps module which only has init()

pull/39/head
Ian Chamberlain 3 years ago
parent
commit
f2f64da50a
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 1
      ctru-rs/src/services/mod.rs
  2. 21
      ctru-rs/src/services/ps.rs

1
ctru-rs/src/services/mod.rs

@ -2,6 +2,7 @@ pub mod apt;
pub mod fs; pub mod fs;
pub mod gspgpu; pub mod gspgpu;
pub mod hid; pub mod hid;
pub mod ps;
pub mod soc; pub mod soc;
pub mod sslc; pub mod sslc;

21
ctru-rs/src/services/ps.rs

@ -0,0 +1,21 @@
#[non_exhaustive]
pub struct Ps;
impl Ps {
pub fn init() -> crate::Result<Self> {
let r = unsafe { ctru_sys::psInit() };
if r < 0 {
Err(r.into())
} else {
Ok(Self)
}
}
}
impl Drop for Ps {
fn drop(&mut self) {
unsafe {
ctru_sys::psExit();
}
}
}
Loading…
Cancel
Save