mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
stm32/rtc: remove use of deprecated .timestamp()
This commit is contained in:
parent
6d35e3f63c
commit
f3efa4ee3b
@ -28,7 +28,7 @@ async fn main(_spawner: Spawner) {
|
||||
loop {
|
||||
let now: NaiveDateTime = rtc.now().unwrap().into();
|
||||
|
||||
info!("{}", now.timestamp());
|
||||
info!("{}", now.and_utc().timestamp());
|
||||
|
||||
Timer::after_millis(1000).await;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) {
|
||||
.unwrap();
|
||||
|
||||
let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
|
||||
info!("Got RTC! {:?}", now.timestamp());
|
||||
info!("Got RTC! {:?}", now.and_utc().timestamp());
|
||||
|
||||
rtc.set_datetime(now.into()).expect("datetime not set");
|
||||
|
||||
@ -32,5 +32,5 @@ async fn main(_spawner: Spawner) {
|
||||
Timer::after_millis(20000).await;
|
||||
|
||||
let then: NaiveDateTime = rtc.now().unwrap().into();
|
||||
info!("Got RTC! {:?}", then.timestamp());
|
||||
info!("Got RTC! {:?}", then.and_utc().timestamp());
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ async fn main(_spawner: Spawner) {
|
||||
.unwrap();
|
||||
|
||||
let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
|
||||
info!("Got RTC! {:?}", now.timestamp());
|
||||
info!("Got RTC! {:?}", now.and_utc().timestamp());
|
||||
|
||||
rtc.set_datetime(now.into()).expect("datetime not set");
|
||||
|
||||
@ -48,5 +48,5 @@ async fn main(_spawner: Spawner) {
|
||||
Timer::after_millis(20000).await;
|
||||
|
||||
let then: NaiveDateTime = rtc.now().unwrap().into();
|
||||
info!("Got RTC! {:?}", then.timestamp());
|
||||
info!("Got RTC! {:?}", then.and_utc().timestamp());
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ async fn main(_spawner: Spawner) {
|
||||
.unwrap();
|
||||
|
||||
let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
|
||||
info!("Got RTC! {:?}", now.timestamp());
|
||||
info!("Got RTC! {:?}", now.and_utc().timestamp());
|
||||
|
||||
rtc.set_datetime(now.into()).expect("datetime not set");
|
||||
|
||||
@ -48,5 +48,5 @@ async fn main(_spawner: Spawner) {
|
||||
Timer::after_millis(20000).await;
|
||||
|
||||
let then: NaiveDateTime = rtc.now().unwrap().into();
|
||||
info!("Got RTC! {:?}", then.timestamp());
|
||||
info!("Got RTC! {:?}", then.and_utc().timestamp());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user