Ian Chamberlain
3 years ago
2 changed files with 22 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -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…
Reference in new issue