Skip to content

Commit 2716579

Browse files
committed
Don't reset PWR on initialization
I haven't seen any specific problems, but I've come across the piece of documentation linked in the comment. Since resetting the peripheral is not necessary here, I prefer to be on the safe side.
1 parent d5035f4 commit 2716579

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pwr.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ pub struct PWR(pac::PWR);
2424
impl PWR {
2525
/// Create an instance of the PWR API
2626
pub fn new(pwr: pac::PWR, rcc: &mut Rcc) -> Self {
27-
// Reset peripheral
28-
rcc.rb.apb1rstr.modify(|_, w| w.pwrrst().set_bit());
29-
rcc.rb.apb1rstr.modify(|_, w| w.pwrrst().clear_bit());
27+
// Peripheral is not being reset here. First, there's no type state here
28+
// that would require any specific configuration. Second, there are
29+
// specific requirements that make resetting the peripheral complicated.
30+
// See STM32L0x2 reference manual, section 6.4.1 (VOS field).
3031

3132
// Enable peripheral clock
3233
rcc.rb.apb1enr.modify(|_, w| w.pwren().set_bit());

0 commit comments

Comments
 (0)