Skip to content

Commit

Permalink
add low hanging sleep/homemenu apt functions
Browse files Browse the repository at this point in the history
  • Loading branch information
adryzz committed Feb 17, 2024
1 parent a32d79f commit 8fd0550
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ctru-rs/src/services/apt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,54 @@ impl Apt {
Ok(())
}
}

/// Set if the console is allowed to enter sleep mode.
///
/// You can check whether the console is allowed to sleep with [Apt::is_sleep_allowed].
#[doc(alias = "aptSetSleepAllowed")]
pub fn set_sleep_allowed(&mut self, allowed: bool) {
unsafe {
ctru_sys::aptSetSleepAllowed(allowed);
}
}

/// Check if the console is allowed to enter sleep mode.
///
/// You can set whether the console is allowed to sleep with [Apt::set_sleep_allowed].

Check warning on line 98 in ctru-rs/src/services/apt.rs

View workflow job for this annotation

GitHub Actions / lint (nightly-2023-06-01)

Diff in /__w/ctru-rs/ctru-rs/ctru-rs/src/services/apt.rs
#[doc(alias = "aptIsSleepAllowed")]
pub fn is_sleep_allowed(&mut self) -> bool {
unsafe {
ctru_sys::aptIsSleepAllowed()
}
}

/// Set if the console is allowed to enter the home menu.
///
/// You can check whether the console is allowed to enter the home menu with [Apt::is_home_allowed].
#[doc(alias = "aptSetHomeAllowed")]
pub fn set_home_allowed(&mut self, allowed: bool) {
unsafe {
ctru_sys::aptSetHomeAllowed(allowed);
}
}

Check warning on line 114 in ctru-rs/src/services/apt.rs

View workflow job for this annotation

GitHub Actions / lint (nightly-2023-06-01)

Diff in /__w/ctru-rs/ctru-rs/ctru-rs/src/services/apt.rs

/// Check if the console is allowed to enter the home menu.
///
/// You can set whether the console is allowed to enter the home menu with [Apt::set_home_allowed].
#[doc(alias = "aptIsHomeAllowed")]
pub fn is_home_allowed(&mut self) -> bool {
unsafe {

Check warning on line 121 in ctru-rs/src/services/apt.rs

View workflow job for this annotation

GitHub Actions / lint (nightly-2023-06-01)

Diff in /__w/ctru-rs/ctru-rs/ctru-rs/src/services/apt.rs
ctru_sys::aptIsHomeAllowed()
}
}

/// Immediately jumps to the home menu.
#[doc(alias = "aptIsHomeAllowed")]

Check warning on line 127 in ctru-rs/src/services/apt.rs

View workflow job for this annotation

GitHub Actions / lint (nightly-2023-06-01)

Diff in /__w/ctru-rs/ctru-rs/ctru-rs/src/services/apt.rs
pub fn jump_to_home_menu(&mut self) {
unsafe {
ctru_sys::aptJumpToHomeMenu()
}
}
}

impl Drop for Apt {
Expand Down

0 comments on commit 8fd0550

Please sign in to comment.