mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 14:44:42 +00:00
Make ConfigError
enum follow naming convention (#2855)
* Make `ConfigError` follow naming convention * changelog entry * !(changelog entry)
This commit is contained in:
parent
62c72947dd
commit
8b16365c2d
@ -132,7 +132,7 @@ impl core::fmt::Display for Error {
|
|||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum ConfigError {
|
pub enum ConfigError {
|
||||||
/// Provided bus frequency is invalid for the current configuration.
|
/// Provided bus frequency is invalid for the current configuration.
|
||||||
InvalidFrequency,
|
FrequencyInvalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl core::error::Error for ConfigError {}
|
impl core::error::Error for ConfigError {}
|
||||||
@ -140,7 +140,7 @@ impl core::error::Error for ConfigError {}
|
|||||||
impl core::fmt::Display for ConfigError {
|
impl core::fmt::Display for ConfigError {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
ConfigError::InvalidFrequency => write!(
|
ConfigError::FrequencyInvalid => write!(
|
||||||
f,
|
f,
|
||||||
"Provided bus frequency is invalid for the current configuration"
|
"Provided bus frequency is invalid for the current configuration"
|
||||||
),
|
),
|
||||||
@ -932,7 +932,7 @@ fn configure_clock(
|
|||||||
#[cfg(not(esp32))]
|
#[cfg(not(esp32))]
|
||||||
let scl_wait_high_period = scl_wait_high_period
|
let scl_wait_high_period = scl_wait_high_period
|
||||||
.try_into()
|
.try_into()
|
||||||
.map_err(|_| ConfigError::InvalidFrequency)?;
|
.map_err(|_| ConfigError::FrequencyInvalid)?;
|
||||||
|
|
||||||
register_block.scl_high_period().write(|w| {
|
register_block.scl_high_period().write(|w| {
|
||||||
#[cfg(not(esp32))] // ESP32 does not have a wait_high field
|
#[cfg(not(esp32))] // ESP32 does not have a wait_high field
|
||||||
|
Loading…
x
Reference in New Issue
Block a user