Skip to content

Commit

Permalink
Allow inlining cpu functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Feb 5, 2025
1 parent edb5b7b commit db8a6c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions esp-hal/src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,29 @@ bitflags::bitflags! {
}

/// Performs a software reset on the chip.
#[inline]
pub fn software_reset() {
crate::rom::software_reset();
}

/// Resets the given CPU, leaving peripherals unchanged.
#[instability::unstable]
#[inline]
pub fn software_reset_cpu(cpu: Cpu) {
crate::rom::software_reset_cpu(cpu as u32);
}

/// Retrieves the reason for the last reset as a SocResetReason enum value.
/// Returns `None` if the reset reason cannot be determined.
#[instability::unstable]
#[inline]
pub fn reset_reason() -> Option<SocResetReason> {
crate::rtc_cntl::reset_reason(Cpu::current())
}

/// Retrieves the cause of the last wakeup event as a SleepSource enum value.
#[instability::unstable]
#[inline]
pub fn wakeup_cause() -> SleepSource {
crate::rtc_cntl::wakeup_cause()
}

0 comments on commit db8a6c3

Please sign in to comment.