diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 616b8d4..8c11799 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -102,23 +102,23 @@ fn main() { hid.scan_input(); let keys_down = hid.keys_down(); - if keys_down.contains(KeyPad::KEY_START) { + if keys_down.contains(KeyPad::START) { break; } // break in order to return to hbmenu - if keys_down.intersects(KeyPad::KEY_DOWN) { + if keys_down.intersects(KeyPad::DOWN) { note = note.saturating_sub(1); - } else if keys_down.intersects(KeyPad::KEY_UP) { + } else if keys_down.intersects(KeyPad::UP) { note = std::cmp::min(note + 1, NOTEFREQ.len() - 1); } let mut update_params = false; - if keys_down.intersects(KeyPad::KEY_LEFT) { + if keys_down.intersects(KeyPad::LEFT) { filter -= 1; filter = filter.rem_euclid(filter_names.len() as _); update_params = true; - } else if keys_down.intersects(KeyPad::KEY_RIGHT) { + } else if keys_down.intersects(KeyPad::RIGHT) { filter += 1; filter = filter.rem_euclid(filter_names.len() as _); diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index c8f9f71..1cc5355 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -42,19 +42,19 @@ fn main() { // You can also use the .bits() method to do direct comparisons on // the underlying bits - if keys.contains(KeyPad::KEY_A) { + if keys.contains(KeyPad::A) { println!("You held A!"); } - if keys.bits() & KeyPad::KEY_B.bits() != 0 { + if keys.bits() & KeyPad::B.bits() != 0 { println!("You held B!"); } - if keys.contains(KeyPad::KEY_X | KeyPad::KEY_Y) { + if keys.contains(KeyPad::X | KeyPad::Y) { println!("You held X and Y!"); } - if keys.intersects(KeyPad::KEY_L | KeyPad::KEY_R | KeyPad::KEY_ZL | KeyPad::KEY_ZR) { + if keys.intersects(KeyPad::L | KeyPad::R | KeyPad::ZL | KeyPad::ZR) { println!("You held a shoulder button!"); } - if keys.intersects(KeyPad::KEY_START) { + if keys.intersects(KeyPad::START) { println!("See ya!"); break; } diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 7922f20..7559275 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -65,11 +65,11 @@ fn main() { hid.scan_input(); keys_down = hid.keys_down(); - if keys_down.contains(KeyPad::KEY_START) { + if keys_down.contains(KeyPad::START) { break; } - if keys_down.contains(KeyPad::KEY_R) { + if keys_down.contains(KeyPad::R) { println!("Capturing new image"); let camera = &mut cam.outer_right_cam; diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 3bfeadc..88de947 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -56,15 +56,15 @@ impl<'a> FileExplorer<'a> { self.hid.scan_input(); let input = self.hid.keys_down(); - if input.contains(KeyPad::KEY_START) { + if input.contains(KeyPad::START) { break; - } else if input.contains(KeyPad::KEY_B) && self.path.components().count() > 1 { + } else if input.contains(KeyPad::B) && self.path.components().count() > 1 { self.path.pop(); self.console.clear(); self.print_menu(); - } else if input.contains(KeyPad::KEY_A) { + } else if input.contains(KeyPad::A) { self.get_input_and_run(Self::set_next_path); - } else if input.contains(KeyPad::KEY_X) { + } else if input.contains(KeyPad::X) { self.get_input_and_run(Self::set_exact_path); } @@ -147,11 +147,11 @@ impl<'a> FileExplorer<'a> { self.hid.scan_input(); let input = self.hid.keys_down(); - if input.contains(KeyPad::KEY_A) { + if input.contains(KeyPad::A) { break; } - if input.contains(KeyPad::KEY_START) { + if input.contains(KeyPad::START) { self.running = false; return; } diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 171838b..da7150a 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -31,7 +31,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } @@ -44,7 +44,7 @@ fn main() { right_buf.ptr.copy_from(ZERO.as_ptr(), ZERO.len()); } - if hid.keys_down().contains(KeyPad::KEY_A) { + if hid.keys_down().contains(KeyPad::A) { // flip which buffer we're writing to current_side = match current_side { Side::Left => Side::Right, diff --git a/ctru-rs/examples/gfx-wide-mode.rs b/ctru-rs/examples/gfx-wide-mode.rs index 2d25f7f..ae263cd 100644 --- a/ctru-rs/examples/gfx-wide-mode.rs +++ b/ctru-rs/examples/gfx-wide-mode.rs @@ -13,11 +13,11 @@ fn main() { while apt.main_loop() { hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } - if hid.keys_down().contains(KeyPad::KEY_A) { + if hid.keys_down().contains(KeyPad::A) { drop(console); let wide_mode = gfx.top_screen.borrow().get_wide_mode(); diff --git a/ctru-rs/examples/graphics-bitmap.rs b/ctru-rs/examples/graphics-bitmap.rs index 5421e9b..e2b7def 100644 --- a/ctru-rs/examples/graphics-bitmap.rs +++ b/ctru-rs/examples/graphics-bitmap.rs @@ -43,7 +43,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } diff --git a/ctru-rs/examples/hashmaps.rs b/ctru-rs/examples/hashmaps.rs index 42efee2..e6b9619 100644 --- a/ctru-rs/examples/hashmaps.rs +++ b/ctru-rs/examples/hashmaps.rs @@ -26,7 +26,7 @@ fn main() { gfx.wait_for_vblank(); hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } } diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 38934d3..601027f 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -32,7 +32,7 @@ fn main() { gfx.wait_for_vblank(); hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } } diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 910813a..d61a7bc 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -26,7 +26,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/linear-memory.rs b/ctru-rs/examples/linear-memory.rs index 440e62b..a44a35f 100644 --- a/ctru-rs/examples/linear-memory.rs +++ b/ctru-rs/examples/linear-memory.rs @@ -34,7 +34,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index 84115b6..7488c0c 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -30,7 +30,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index e53ef42..db750bc 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -61,7 +61,7 @@ fn main() { } hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; }; } diff --git a/ctru-rs/examples/output-3dslink.rs b/ctru-rs/examples/output-3dslink.rs index 2d6b147..61731d2 100644 --- a/ctru-rs/examples/output-3dslink.rs +++ b/ctru-rs/examples/output-3dslink.rs @@ -30,7 +30,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/romfs.rs b/ctru-rs/examples/romfs.rs index 965cb6d..f52fff3 100644 --- a/ctru-rs/examples/romfs.rs +++ b/ctru-rs/examples/romfs.rs @@ -33,7 +33,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 0415b10..ffa096c 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -18,7 +18,7 @@ fn main() { hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_A) { + if hid.keys_down().contains(KeyPad::A) { // Prepares a software keyboard with two buttons: One to cancel input and one // to accept it. You can also use `Swkbd::init()` to launch the keyboard in different // configurations. @@ -37,7 +37,7 @@ fn main() { } } - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } } diff --git a/ctru-rs/examples/system-configuration.rs b/ctru-rs/examples/system-configuration.rs index 284e3f1..fde7d18 100644 --- a/ctru-rs/examples/system-configuration.rs +++ b/ctru-rs/examples/system-configuration.rs @@ -19,7 +19,7 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } // Flush and swap framebuffers diff --git a/ctru-rs/examples/time-rtc.rs b/ctru-rs/examples/time-rtc.rs index b7ff399..a229105 100644 --- a/ctru-rs/examples/time-rtc.rs +++ b/ctru-rs/examples/time-rtc.rs @@ -16,7 +16,7 @@ fn main() { // Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index 1f5654f..6dd39a6 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -35,10 +35,10 @@ fn main() { //Scan all the inputs. This should be done once for each frame hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } - if hid.keys_down().contains(KeyPad::KEY_SELECT) { + if hid.keys_down().contains(KeyPad::SELECT) { refresh = true; offset = 0; use_nand = !use_nand; @@ -46,12 +46,12 @@ fn main() { let cur_list = if use_nand { &nand_list } else { &sd_list }; - if hid.keys_down().intersects(KeyPad::KEY_DOWN) { + if hid.keys_down().intersects(KeyPad::DOWN) { if offset + 1 < cur_list.len() { offset = offset + 1; refresh = true; } - } else if hid.keys_down().intersects(KeyPad::KEY_UP) { + } else if hid.keys_down().intersects(KeyPad::UP) { if offset > 0 { offset = offset - 1; refresh = true; diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 2db6c22..bcd60e0 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -15,10 +15,10 @@ extern crate pthread_3ds; #[cfg(feature = "big-stack")] static __stacksize__: usize = 2 * 1024 * 1024; // 2MB -/// Activate ´ctru-rs´' default panic handler. +/// Activate the default panic handler. /// /// With this implementation, the main thread will stop and try to print debug info to an available [console::Console]. -/// In case it fails to find an active [console::Console], the program will just exit. +/// In case it fails to find an active [console::Console] the program will just exit. /// /// # Notes /// @@ -48,7 +48,7 @@ fn panic_hook_setup() { Ok(hid) => loop { hid.scan_input(); let keys = hid.keys_down(); - if keys.contains(KeyPad::KEY_SELECT) { + if keys.contains(KeyPad::SELECT) { break; } }, diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 6cd3728..f53b24c 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -1,7 +1,7 @@ //! Filesystem service //! //! This module contains basic methods to manipulate the contents of the 3DS's filesystem. -//! Only the SD card is currently supported. +//! Only the SD card is currently supported. You should prefer using `std::fs`. use bitflags::bitflags; use std::ffi::OsString; @@ -52,38 +52,40 @@ pub enum FsMediaType { } #[derive(Copy, Clone, Debug)] +#[repr(u32)] pub enum PathType { - Invalid, - Empty, - Binary, - ASCII, - UTF16, + Invalid = ctru_sys::PATH_INVALID, + Empty = ctru_sys::PATH_EMPTY, + Binary = ctru_sys::PATH_BINARY, + ASCII = ctru_sys::PATH_ASCII, + UTF16 = ctru_sys::PATH_UTF16, } #[derive(Copy, Clone, Debug)] +#[repr(u32)] pub enum ArchiveID { - RomFS, - Savedata, - Extdata, - SharedExtdata, - SystemSavedata, - Sdmc, - SdmcWriteOnly, - BossExtdata, - CardSpiFS, - ExtDataAndBossExtdata, - SystemSaveData2, - NandRW, - NandRO, - NandROWriteAccess, - SaveDataAndContent, - SaveDataAndContent2, - NandCtrFS, - TwlPhoto, - NandTwlFS, - GameCardSavedata, - UserSavedata, - DemoSavedata, + RomFS = ctru_sys::ARCHIVE_ROMFS, + Savedata = ctru_sys::ARCHIVE_ROMFS, + Extdata = ctru_sys::ARCHIVE_ROMFS, + SharedExtdata = ctru_sys::ARCHIVE_ROMFS, + SystemSavedata = ctru_sys::ARCHIVE_ROMFS, + Sdmc = ctru_sys::ARCHIVE_ROMFS, + SdmcWriteOnly = ctru_sys::ARCHIVE_ROMFS, + BossExtdata = ctru_sys::ARCHIVE_ROMFS, + CardSpiFS = ctru_sys::ARCHIVE_ROMFS, + ExtDataAndBossExtdata = ctru_sys::ARCHIVE_ROMFS, + SystemSaveData2 = ctru_sys::ARCHIVE_ROMFS, + NandRW = ctru_sys::ARCHIVE_ROMFS, + NandRO = ctru_sys::ARCHIVE_ROMFS, + NandROWriteAccess = ctru_sys::ARCHIVE_ROMFS, + SaveDataAndContent = ctru_sys::ARCHIVE_ROMFS, + SaveDataAndContent2 = ctru_sys::ARCHIVE_ROMFS, + NandCtrFS = ctru_sys::ARCHIVE_ROMFS, + TwlPhoto = ctru_sys::ARCHIVE_ROMFS, + NandTwlFS = ctru_sys::ARCHIVE_ROMFS, + GameCardSavedata = ctru_sys::ARCHIVE_ROMFS, + UserSavedata = ctru_sys::ARCHIVE_ROMFS, + DemoSavedata = ctru_sys::ARCHIVE_ROMFS, } /// Represents the filesystem service. No file IO can be performed diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 6aacf3a..26b034f 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -10,34 +10,34 @@ bitflags::bitflags! { /// inputs on the 3DS #[derive(Default)] pub struct KeyPad: u32 { - const KEY_A = 1u32 << 0; - const KEY_B = 1u32 << 1; - const KEY_SELECT = 1u32 << 2; - const KEY_START = 1u32 << 3; - const KEY_DRIGHT = 1u32 << 4; - const KEY_DLEFT = 1u32 << 5; - const KEY_DUP = 1u32 << 6; - const KEY_DDOWN = 1u32 << 7; - const KEY_R = 1u32 << 8; - const KEY_L = 1u32 << 9; - const KEY_X = 1u32 << 10; - const KEY_Y = 1u32 << 11; - const KEY_ZL = 1u32 << 14; - const KEY_ZR = 1u32 << 15; - const KEY_TOUCH = 1u32 << 20; - const KEY_CSTICK_RIGHT = 1u32 << 24; - const KEY_CSTICK_LEFT = 1u32 << 25; - const KEY_CSTICK_UP = 1u32 << 26; - const KEY_CSTICK_DOWN = 1u32 << 27; - const KEY_CPAD_RIGHT = 1u32 << 28; - const KEY_CPAD_LEFT = 1u32 << 29; - const KEY_CPAD_UP = 1u32 << 30; - const KEY_CPAD_DOWN = 1u32 << 31; - // convenience catch-all for the dpad and cpad - const KEY_UP = KeyPad::KEY_DUP.bits | KeyPad::KEY_CPAD_UP.bits; - const KEY_DOWN = KeyPad::KEY_DDOWN.bits | KeyPad::KEY_CPAD_DOWN.bits; - const KEY_LEFT = KeyPad::KEY_DLEFT.bits | KeyPad::KEY_CPAD_LEFT.bits; - const KEY_RIGHT = KeyPad::KEY_DRIGHT.bits | KeyPad::KEY_CPAD_RIGHT.bits; + const A = ctru_sys::KEY_A; + const B = ctru_sys::KEY_B; + const SELECT = ctru_sys::KEY_SELECT; + const START = ctru_sys::KEY_START; + const DRIGHT = ctru_sys::KEY_DRIGHT; + const DLEFT = ctru_sys::KEY_DLEFT; + const DUP = ctru_sys::KEY_DUP; + const DDOWN = ctru_sys::KEY_DDOWN; + const R = ctru_sys::KEY_R; + const L = ctru_sys::KEY_L; + const X = ctru_sys::KEY_X; + const Y = ctru_sys::KEY_Y; + const ZL = ctru_sys::KEY_ZL; + const ZR = ctru_sys::KEY_ZR; + const TOUCH = ctru_sys::KEY_TOUCH; + const CSTICK_RIGHT = ctru_sys::KEY_CSTICK_RIGHT; + const CSTICK_LEFT = ctru_sys::KEY_CSTICK_LEFT; + const CSTICK_UP = ctru_sys::KEY_CSTICK_UP; + const CSTICK_DOWN = ctru_sys::KEY_CSTICK_DOWN; + const CPAD_RIGHT = ctru_sys::KEY_CPAD_RIGHT; + const CPAD_LEFT = ctru_sys::KEY_CPAD_LEFT; + const CPAD_UP = ctru_sys::KEY_CPAD_UP; + const CPAD_DOWN = ctru_sys::KEY_CPAD_DOWN; + // Convenience catch-all for the dpad and cpad + const UP = KeyPad::DUP.bits() | KeyPad::CPAD_UP.bits(); + const DOWN = KeyPad::DDOWN.bits() | KeyPad::CPAD_DOWN.bits(); + const LEFT = KeyPad::DLEFT.bits() | KeyPad::CPAD_LEFT.bits(); + const RIGHT = KeyPad::DRIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index 79ebcd7..8795b32 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -8,26 +8,26 @@ use crate::Result; #[repr(u32)] pub enum AESAlgorithm { - CbcEnc, - CbcDec, - CtrEnc, - CtrDec, - CcmEnc, - CcmDec, + CbcEnc = ctru_sys::PS_ALGORITHM_CBC_ENC, + CbcDec = ctru_sys::PS_ALGORITHM_CBC_DEC, + CtrEnc = ctru_sys::PS_ALGORITHM_CTR_ENC, + CtrDec = ctru_sys::PS_ALGORITHM_CTR_DEC, + CcmEnc = ctru_sys::PS_ALGORITHM_CCM_ENC, + CcmDec = ctru_sys::PS_ALGORITHM_CCM_DEC, } #[repr(u32)] pub enum AESKeyType { - Keyslot0D, - Keyslot2D, - Keyslot31, - Keyslot38, - Keyslot32, - Keyslot39Dlp, - Keyslot2E, - KeyslotInvalid, - Keyslot36, - Keyslot39Nfc, + Keyslot0D = ctru_sys::PS_KEYSLOT_0D, + Keyslot2D = ctru_sys::PS_KEYSLOT_2D, + Keyslot2E = ctru_sys::PS_KEYSLOT_2E, + Keyslot31 = ctru_sys::PS_KEYSLOT_31, + Keyslot32 = ctru_sys::PS_KEYSLOT_32, + Keyslot36 = ctru_sys::PS_KEYSLOT_36, + Keyslot38 = ctru_sys::PS_KEYSLOT_38, + Keyslot39Dlp = ctru_sys::PS_KEYSLOT_39_DLP, + Keyslot39Nfc = ctru_sys::PS_KEYSLOT_39_NFC, + KeyslotInvalid = ctru_sys::PS_KEYSLOT_INVALID, } pub struct Ps(()); diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index aecd889..2b7ae7d 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -1,3 +1,5 @@ +//! Network Socket + use libc::memalign; use std::net::Ipv4Addr; use std::sync::Mutex; @@ -6,8 +8,10 @@ use crate::error::ResultCode; use crate::services::ServiceReference; use crate::Error; -/// Soc service. Initializing this service will enable the use of network sockets and utilities -/// such as those found in `std::net`. The service will be closed when this struct is is dropped. +/// Network socket service +/// +/// Initializing this service will enable the use of network sockets and utilities +/// such as those found in `std::net`. The service will close once this struct gets dropped. pub struct Soc { _service_handler: ServiceReference, sock_3dslink: libc::c_int, diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index aa4d26f..99eb456 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -1,3 +1,5 @@ +//! SSLC (TLS) service + // TODO: Implement remaining functions use crate::error::ResultCode; @@ -5,7 +7,7 @@ use crate::error::ResultCode; pub struct SslC(()); impl SslC { - /// Initialize sslc + /// Initialize the service pub fn init() -> crate::Result { unsafe { ResultCode(ctru_sys::sslcInit(0))?; diff --git a/ctru-rs/src/test_runner.rs b/ctru-rs/src/test_runner.rs index 00634f6..1f0698f 100644 --- a/ctru-rs/src/test_runner.rs +++ b/ctru-rs/src/test_runner.rs @@ -44,7 +44,7 @@ pub(crate) fn run(tests: &[&TestDescAndFn]) { gfx.wait_for_vblank(); hid.scan_input(); - if hid.keys_down().contains(KeyPad::KEY_START) { + if hid.keys_down().contains(KeyPad::START) { break; } }