From fbd873432c8512236eb0936ea8952795e1b63a5c Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 1 Feb 2022 19:28:27 +0100 Subject: [PATCH] Revert "Removed link field in ctru-sys" This reverts commit c59de27f853dc69bb8087cad074f06bba591d444. --- ctru-rs/examples/hello-world.rs | 22 ++++++++-------------- ctru-sys/Cargo.toml | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index d617223..930549f 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -12,22 +12,16 @@ fn main() { let apt = Apt::init().expect("Couldn't obtain APT controller"); let _console = Console::init(gfx.top_screen.borrow_mut()); - struct Timespec { - t: libc::timespec, - } - - //let inst = std::time::Instant::now(); - let mut t = Timespec { t: libc::timespec { tv_sec: 0, tv_nsec: 0 } }; - let res = unsafe { libc::clock_gettime(libc::CLOCK_MONOTONIC, &mut t.t) }; - println!("{{tv_sec: {}, tv_nsec: {} }} {} clock:{}", t.t.tv_sec, t.t.tv_nsec, res, libc::CLOCK_MONOTONIC); - ctru::thread::sleep(std::time::Duration::from_secs(2)); - /*let ela = inst.elapsed(); - println!( - "\x1b[0;0HElapsed: {:#?}", - ela - );*/ + let out = b"Hello fellow Rustaceans, I'm on the Nintendo 3DS!"; + let width = 24; + let mut writer = BufWriter::new(Vec::new()); + ferris_says::say(out, width, &mut writer).unwrap(); + println!( + "\x1b[0;0H{}", + String::from_utf8_lossy(&writer.into_inner().unwrap()) + ); // Main loop while apt.main_loop() { diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 46bed0b..8c059bb 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "ctru-sys" version = "0.4.0" authors = ["Ronald Kinard "] license = "https://en.wikipedia.org/wiki/Zlib_License" +links = "ctru" edition = "2021" [dependencies]