Skip to content

Commit

Permalink
Make ConfigError follow naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Dec 20, 2024
1 parent 2862197 commit 51340ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esp-hal/src/i2c/master/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ impl core::fmt::Display for Error {
#[non_exhaustive]
pub enum ConfigError {
/// Provided bus frequency is invalid for the current configuration.
InvalidFrequency,
FrequencyInvalid,
}

impl core::error::Error for ConfigError {}

impl core::fmt::Display for ConfigError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
ConfigError::InvalidFrequency => write!(
ConfigError::FrequencyInvalid => write!(
f,
"Provided bus frequency is invalid for the current configuration"
),
Expand Down Expand Up @@ -932,7 +932,7 @@ fn configure_clock(
#[cfg(not(esp32))]
let scl_wait_high_period = scl_wait_high_period
.try_into()
.map_err(|_| ConfigError::InvalidFrequency)?;
.map_err(|_| ConfigError::FrequencyInvalid)?;

register_block.scl_high_period().write(|w| {
#[cfg(not(esp32))] // ESP32 does not have a wait_high field
Expand Down

0 comments on commit 51340ad

Please sign in to comment.