Skip to content

Commit

Permalink
Merge #372
Browse files Browse the repository at this point in the history
372: Fix, enable PWR clock before accessing the PWR_CR r=burrbull a=apeng2012

dbp can't be written to unless PWRen has been set.


Co-authored-by: apeng2012 <[email protected]>
  • Loading branch information
bors[bot] and apeng2012 authored Nov 15, 2021
2 parents f101160 + e0acb5e commit 127ab14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- RTC not enable PWR clock
- USART2 remap
- Fix > 2 byte i2c reads
- Send stop after acknowledge errors on i2c
Expand Down
1 change: 1 addition & 0 deletions src/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ impl BKP {
// Enable the backup interface by setting PWREN and BKPEN
let rcc = unsafe { &(*RCC::ptr()) };
crate::pac::BKP::enable(rcc);
crate::pac::PWR::enable(rcc);

// Enable access to the backup registers
pwr.cr.modify(|_r, w| w.dbp().set_bit());
Expand Down

0 comments on commit 127ab14

Please sign in to comment.