summaryrefslogtreecommitdiff
path: root/src/ds3231.rs
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2017-09-21 23:04:45 -0400
committerDeterminant <ted.sybil@gmail.com>2017-09-21 23:04:45 -0400
commita459ddf4bfe00f956bf0ffffe70d57585e889501 (patch)
tree23449bf61263976102b028154dbb630ffeb25e3d /src/ds3231.rs
parent561887acffccb8d4757d931eedfa2e494946efd1 (diff)
sync with ds3231 every 10s
Diffstat (limited to 'src/ds3231.rs')
-rw-r--r--src/ds3231.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ds3231.rs b/src/ds3231.rs
index 6b20958..0e1d561 100644
--- a/src/ds3231.rs
+++ b/src/ds3231.rs
@@ -22,8 +22,9 @@ pub struct Date {
}
impl<'a> DS3231<'a> {
- pub fn new(i2c_reg: &'a stm32f103xx::i2c1::RegisterBlock) -> DS3231<'a> {
- DS3231{i2c: I2C::new(i2c_reg)}
+ pub fn new(i2c_reg: &'a stm32f103xx::i2c1::RegisterBlock,
+ rcc_reg: &'a stm32f103xx::rcc::RegisterBlock) -> DS3231<'a> {
+ DS3231{i2c: I2C::new(i2c_reg, rcc_reg)}
}
fn bcd2dec(bcd: u8) -> u8 {