Skip to content

Commit

Permalink
Mark software_reset no-return
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Feb 5, 2025
1 parent d7688cc commit 7d5ce8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions esp-hal/src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ bitflags::bitflags! {

/// Performs a software reset on the chip.
#[inline]
pub fn software_reset() {
crate::rom::software_reset();
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);
crate::rom::software_reset_cpu(cpu as u32)
}

/// Retrieves the reason for the last reset as a SocResetReason enum value.
Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/rom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ pub(crate) fn software_reset_cpu(cpu_num: u32) {
}

#[inline(always)]
pub(crate) fn software_reset() {
pub(crate) fn software_reset() -> ! {
extern "C" {
fn software_reset();
fn software_reset() -> !;
}

unsafe { software_reset() };
unsafe { software_reset() }
}

#[cfg(esp32s3)]
Expand Down

0 comments on commit 7d5ce8d

Please sign in to comment.