Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

Commit a637a7b

Browse files
committed
Use correct rcc registers for rtc
1 parent 41c421f commit a637a7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rtc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use stm32f103xx::{RTC, PWR};
2-
use rcc::Rcc;
2+
use rcc::{APB1, BDCR};
33

44

55
/*
@@ -27,9 +27,9 @@ pub struct Rtc {
2727

2828

2929
impl Rtc {
30-
pub fn rtc(regs: RTC, rcc: &mut Rcc, pwr: &mut PWR) -> Self {
30+
pub fn rtc(regs: RTC, apb1: &mut APB1, bdcr: &mut BDCR, pwr: &mut PWR) -> Self {
3131
// Enable the backup interface by setting PWREN and BKPEN
32-
rcc.apb1.enr().modify(|_r, w| {
32+
apb1.enr().modify(|_r, w| {
3333
w
3434
.bkpen().set_bit()
3535
.pwren().set_bit()
@@ -42,7 +42,7 @@ impl Rtc {
4242

4343
// Configure the perscaler to use the LSE clock as defined in the documentation
4444
// in section 7.2.4. This gives a 32.768khz frequency for the RTC
45-
rcc.bdcr.bdcr().modify(|_, w| {
45+
bdcr.bdcr().modify(|_, w| {
4646
w
4747
// Enable external low speed oscilator
4848
.lseon().set_bit()

0 commit comments

Comments
 (0)