Skip to content

Commit

Permalink
Add safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 4, 2024
1 parent 1c159a5 commit 1645bb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion esp-hal/src/clock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ impl Clocks {
}

fn try_get() -> Option<&'static Clocks> {
unsafe { ACTIVE_CLOCKS.as_ref() }
unsafe {
// Safety: ACTIVE_CLOCKS is only set in `init` and never modified after that.
ACTIVE_CLOCKS.as_ref()
}
}

/// Get the active clock configuration.
Expand Down

0 comments on commit 1645bb5

Please sign in to comment.