stm32/low-power: refactor refcount

This commit is contained in:
xoviat
2023-10-25 19:07:31 -05:00
parent 0cc3e18db6
commit e8a3cfaed6
6 changed files with 29 additions and 35 deletions

View File

@ -564,7 +564,7 @@ fn main() {
fn enable_and_reset_with_cs(_cs: critical_section::CriticalSection) {
#before_enable
#[cfg(feature = "low-power")]
crate::rcc::clock_refcount_add(_cs);
unsafe { crate::rcc::REFCOUNT_STOP2 += 1 };
crate::pac::RCC.#en_reg().modify(|w| w.#set_en_field(true));
#after_enable
#rst
@ -573,7 +573,7 @@ fn main() {
#before_disable
crate::pac::RCC.#en_reg().modify(|w| w.#set_en_field(false));
#[cfg(feature = "low-power")]
crate::rcc::clock_refcount_sub(_cs);
unsafe { crate::rcc::REFCOUNT_STOP2 -= 1 };
}
}