Browse Source

Use the new Ps struct

pull/42/head
AzureMarker 3 years ago
parent
commit
282044068b
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 5
      ctru-rs/examples/futures-tokio-basic.rs

5
ctru-rs/examples/futures-tokio-basic.rs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::ps::Ps;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use std::time::Duration;
@ -9,11 +10,9 @@ fn main() { @@ -9,11 +10,9 @@ fn main() {
let gfx = Gfx::default();
let hid = Hid::init().expect("Couldn't obtain HID controller");
let apt = Apt::init().expect("Couldn't obtain APT controller");
let _ps = Ps::init().expect("Couldn't initialize PS service");
let _console = Console::init(gfx.top_screen.borrow_mut());
// FIXME: replace this with `Ps` when #39 merges
assert!(unsafe { ctru_sys::psInit() } >= 0);
// Give ourselves up to 30% of the system core's time
apt.set_app_cpu_time_limit(30)
.expect("Failed to enable system core");

Loading…
Cancel
Save