use core::{fmt, time::Duration};
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DcSync {
#[default]
Disabled,
Sync0,
Sync01 {
sync1_period: Duration,
},
}
impl fmt::Display for DcSync {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
DcSync::Disabled => f.write_str("disabled"),
DcSync::Sync0 => f.write_str("SYNC0"),
DcSync::Sync01 { sync1_period } => {
write!(f, "SYNC0 with SYNC1 period {} us", sync1_period.as_micros())
}
}
}
}