Skip to content

Commit 15096b2

Browse files
authored
fix nightly ci (#4074)
1 parent 6aaf12a commit 15096b2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

esp-hal/src/clock/mod.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub trait Clock {
8585
}
8686

8787
/// CPU clock speed
88-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
88+
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
8989
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9090
#[allow(
9191
clippy::enum_variant_names,
@@ -95,10 +95,13 @@ pub trait Clock {
9595
pub enum CpuClock {
9696
/// 80MHz CPU clock
9797
#[cfg(not(esp32h2))]
98+
#[default]
99+
// FIXME: I don't think this is correct in general?
98100
_80MHz = 80,
99101

100102
/// 96MHz CPU clock
101103
#[cfg(esp32h2)]
104+
#[default]
102105
_96MHz = 96,
103106

104107
/// 120MHz CPU clock
@@ -114,19 +117,6 @@ pub enum CpuClock {
114117
_240MHz = 240,
115118
}
116119

117-
impl Default for CpuClock {
118-
fn default() -> Self {
119-
cfg_if::cfg_if! {
120-
if #[cfg(esp32h2)] {
121-
Self::_96MHz
122-
} else {
123-
// FIXME: I don't think this is correct in general?
124-
Self::_80MHz
125-
}
126-
}
127-
}
128-
}
129-
130120
impl CpuClock {
131121
#[procmacros::doc_replace]
132122
/// Use the highest possible frequency for a particular chip.

0 commit comments

Comments
 (0)