aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/rtc/datetime.rs
diff options
context:
space:
mode:
authorGeorges Palauqui <[email protected]>2025-01-24 11:58:33 +0100
committerGeorges Palauqui <[email protected]>2025-01-24 11:58:33 +0100
commitda0f6dbe08bb574c5c2bc448199dc2e4f74692de (patch)
treedab46aac37f54ff2ce804a28e3a9d81680238236 /embassy-stm32/src/rtc/datetime.rs
parent4e3d066251578b33d3cb0b8e3d2e44875a001ee5 (diff)
derive defmt::Format on pub struct/enum of stm32::rtc
Diffstat (limited to 'embassy-stm32/src/rtc/datetime.rs')
-rw-r--r--embassy-stm32/src/rtc/datetime.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/embassy-stm32/src/rtc/datetime.rs b/embassy-stm32/src/rtc/datetime.rs
index 32732e96e..526b0cfbd 100644
--- a/embassy-stm32/src/rtc/datetime.rs
+++ b/embassy-stm32/src/rtc/datetime.rs
@@ -3,6 +3,7 @@ use chrono::{Datelike, NaiveDate, Timelike, Weekday};
3 3
4/// Errors regarding the [`DateTime`] struct. 4/// Errors regarding the [`DateTime`] struct.
5#[derive(Clone, Debug, PartialEq, Eq)] 5#[derive(Clone, Debug, PartialEq, Eq)]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6pub enum Error { 7pub enum Error {
7 /// The [DateTime] contains an invalid year value. Must be between `0..=4095`. 8 /// The [DateTime] contains an invalid year value. Must be between `0..=4095`.
8 InvalidYear, 9 InvalidYear,
@@ -24,6 +25,7 @@ pub enum Error {
24} 25}
25 26
26/// Structure containing date and time information 27/// Structure containing date and time information
28#[cfg_attr(feature = "defmt", derive(defmt::Format))]
27pub struct DateTime { 29pub struct DateTime {
28 /// 0..4095 30 /// 0..4095
29 year: u16, 31 year: u16,
@@ -141,6 +143,7 @@ impl From<DateTime> for chrono::NaiveDateTime {
141/// A day of the week 143/// A day of the week
142#[repr(u8)] 144#[repr(u8)]
143#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)] 145#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
146#[cfg_attr(feature = "defmt", derive(defmt::Format))]
144#[allow(missing_docs)] 147#[allow(missing_docs)]
145pub enum DayOfWeek { 148pub enum DayOfWeek {
146 Monday = 1, 149 Monday = 1,