aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-03-06 19:45:57 +0100
committerDario Nieuwenhuis <[email protected]>2024-03-06 19:45:57 +0100
commitf3efa4ee3ba562fd51cd49b70a6c5305a1aaac6a (patch)
treeeed11942c52743f34718bab206c095344b5aefec /examples
parent6d35e3f63ca04e648a2ee33a1737f10704b388b3 (diff)
stm32/rtc: remove use of deprecated .timestamp()
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32f4/src/bin/rtc.rs2
-rw-r--r--examples/stm32h7/src/bin/rtc.rs4
-rw-r--r--examples/stm32l4/src/bin/rtc.rs4
-rw-r--r--examples/stm32wl/src/bin/rtc.rs4
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/stm32f4/src/bin/rtc.rs b/examples/stm32f4/src/bin/rtc.rs
index abab07b6b..82d8a37ba 100644
--- a/examples/stm32f4/src/bin/rtc.rs
+++ b/examples/stm32f4/src/bin/rtc.rs
@@ -28,7 +28,7 @@ async fn main(_spawner: Spawner) {
28 loop { 28 loop {
29 let now: NaiveDateTime = rtc.now().unwrap().into(); 29 let now: NaiveDateTime = rtc.now().unwrap().into();
30 30
31 info!("{}", now.timestamp()); 31 info!("{}", now.and_utc().timestamp());
32 32
33 Timer::after_millis(1000).await; 33 Timer::after_millis(1000).await;
34 } 34 }
diff --git a/examples/stm32h7/src/bin/rtc.rs b/examples/stm32h7/src/bin/rtc.rs
index c6b9cf57e..0adb48877 100644
--- a/examples/stm32h7/src/bin/rtc.rs
+++ b/examples/stm32h7/src/bin/rtc.rs
@@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) {
24 .unwrap(); 24 .unwrap();
25 25
26 let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); 26 let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
27 info!("Got RTC! {:?}", now.timestamp()); 27 info!("Got RTC! {:?}", now.and_utc().timestamp());
28 28
29 rtc.set_datetime(now.into()).expect("datetime not set"); 29 rtc.set_datetime(now.into()).expect("datetime not set");
30 30
@@ -32,5 +32,5 @@ async fn main(_spawner: Spawner) {
32 Timer::after_millis(20000).await; 32 Timer::after_millis(20000).await;
33 33
34 let then: NaiveDateTime = rtc.now().unwrap().into(); 34 let then: NaiveDateTime = rtc.now().unwrap().into();
35 info!("Got RTC! {:?}", then.timestamp()); 35 info!("Got RTC! {:?}", then.and_utc().timestamp());
36} 36}
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs
index a8a375ab4..f554f0f78 100644
--- a/examples/stm32l4/src/bin/rtc.rs
+++ b/examples/stm32l4/src/bin/rtc.rs
@@ -40,7 +40,7 @@ async fn main(_spawner: Spawner) {
40 .unwrap(); 40 .unwrap();
41 41
42 let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); 42 let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
43 info!("Got RTC! {:?}", now.timestamp()); 43 info!("Got RTC! {:?}", now.and_utc().timestamp());
44 44
45 rtc.set_datetime(now.into()).expect("datetime not set"); 45 rtc.set_datetime(now.into()).expect("datetime not set");
46 46
@@ -48,5 +48,5 @@ async fn main(_spawner: Spawner) {
48 Timer::after_millis(20000).await; 48 Timer::after_millis(20000).await;
49 49
50 let then: NaiveDateTime = rtc.now().unwrap().into(); 50 let then: NaiveDateTime = rtc.now().unwrap().into();
51 info!("Got RTC! {:?}", then.timestamp()); 51 info!("Got RTC! {:?}", then.and_utc().timestamp());
52} 52}
diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs
index 0c26426ef..cf7d6d220 100644
--- a/examples/stm32wl/src/bin/rtc.rs
+++ b/examples/stm32wl/src/bin/rtc.rs
@@ -40,7 +40,7 @@ async fn main(_spawner: Spawner) {
40 .unwrap(); 40 .unwrap();
41 41
42 let mut rtc = Rtc::new(p.RTC, RtcConfig::default()); 42 let mut rtc = Rtc::new(p.RTC, RtcConfig::default());
43 info!("Got RTC! {:?}", now.timestamp()); 43 info!("Got RTC! {:?}", now.and_utc().timestamp());
44 44
45 rtc.set_datetime(now.into()).expect("datetime not set"); 45 rtc.set_datetime(now.into()).expect("datetime not set");
46 46
@@ -48,5 +48,5 @@ async fn main(_spawner: Spawner) {
48 Timer::after_millis(20000).await; 48 Timer::after_millis(20000).await;
49 49
50 let then: NaiveDateTime = rtc.now().unwrap().into(); 50 let then: NaiveDateTime = rtc.now().unwrap().into();
51 info!("Got RTC! {:?}", then.timestamp()); 51 info!("Got RTC! {:?}", then.and_utc().timestamp());
52} 52}