summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1970dfd..f52e22b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,16 +1,12 @@
-#![no_std]
+#![feature(restricted_std)]
-use core::{panic::PanicInfo, ptr::null_mut};
+use core::ptr::null_mut;
use libctru::raw::{
aptMainLoop, c_char, c_int, consoleInit, gfxExit, gfxFlushBuffers, gfxInitDefault,
gfxScreen_t_GFX_TOP, gfxSwapBuffers, gspWaitForEvent, hidKeysDown, hidScanInput,
GSPGPU_Event_GSPGPU_EVENT_VBlank0, KEY_START,
};
-extern "C" {
- fn puts(string: *const c_char);
-}
-
#[no_mangle]
pub extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
unsafe {
@@ -18,7 +14,15 @@ pub extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
consoleInit(gfxScreen_t_GFX_TOP, null_mut());
- puts("Hello World from Rust".as_ptr());
+ libctru::println!("Standard print in next line:");
+ println!("Standard print");
+
+ std::thread::spawn(|| {
+ println!("Hello thread world");
+ })
+ .join();
+
+ libctru::println!("Check end");
while aptMainLoop() {
hidScanInput();
@@ -39,8 +43,3 @@ pub extern "C" fn main(_argc: c_int, _argv: *const *const c_char) -> c_int {
0
}
-
-#[panic_handler]
-fn panic(_info: &PanicInfo) -> ! {
- loop {}
-}