From 01da9fd7c1e8676c75f400de9f41c5597f2e4838 Mon Sep 17 00:00:00 2001 From: Andrew Herbert Date: Wed, 15 Nov 2023 21:35:12 +1100 Subject: [PATCH] additional safety comments for rosc/xosc dormant() - thanks @jannic --- rp2040-hal/src/rosc.rs | 1 + rp2040-hal/src/xosc.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/rp2040-hal/src/rosc.rs b/rp2040-hal/src/rosc.rs index abcc3efc1..7cc99ea8d 100644 --- a/rp2040-hal/src/rosc.rs +++ b/rp2040-hal/src/rosc.rs @@ -100,6 +100,7 @@ impl RingOscillator { /// This method is marked unsafe because prior to switch the ROSC into DORMANT state, /// PLLs must be stopped and IRQs have to be properly configured. /// This method does not do any of that, it merely switches the ROSC to DORMANT state. + /// It should only be called if this oscillator is the clock source for the system clock. /// See Chapter 2, Section 16, §5) for details. pub unsafe fn dormant(self) { //taken from the C SDK diff --git a/rp2040-hal/src/xosc.rs b/rp2040-hal/src/xosc.rs index a79243bf3..94254fe62 100644 --- a/rp2040-hal/src/xosc.rs +++ b/rp2040-hal/src/xosc.rs @@ -171,6 +171,7 @@ impl CrystalOscillator { /// This method is marked unsafe because prior to switch the XOSC into DORMANT state, /// PLLs must be stopped and IRQs have to be properly configured. /// This method does not do any of that, it merely switches the XOSC to DORMANT state. + /// It should only be called if this oscillator is the clock source for the system clock. /// See Chapter 2, Section 16, §5) for details. pub unsafe fn dormant(self) -> CrystalOscillator { //taken from the C SDK