Add derive(Debug) and derive(defmt::Format) to error types

This commit is contained in:
9names 2022-10-27 19:17:03 +11:00
parent 8e79f438ba
commit 219d393085
5 changed files with 7 additions and 0 deletions

View file

@ -43,6 +43,7 @@ use crate::Sio;
/// Errors for multicore operations.
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// Operation is invalid on this core.
InvalidCore,

View file

@ -73,6 +73,8 @@ impl<S: State, D: PhaseLockedLoopDevice> PhaseLockedLoop<S, D> {
/// Error type for the PLL module.
/// See Chapter 2, Section 18 §2 for details on constraints triggering these errors.
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// Proposed VCO frequency is out of range.
VcoFreqOutOfRange,

View file

@ -4,6 +4,7 @@ use rp2040_pac::rtc::{rtc_0, rtc_1, setup_0, setup_1};
///
/// [`DateTimeFilter`]: struct.DateTimeFilter.html
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// The [DateTime] contains an invalid year value. Must be between `0..=4095`.
InvalidYear,

View file

@ -5,6 +5,7 @@ use fugit::HertzU32;
/// Error type for UART operations.
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// Bad argument : when things overflow, ...
BadArgument,

View file

@ -32,6 +32,8 @@ impl State for Stable {}
impl State for Dormant {}
/// Possible errors when initializing the CrystalOscillator
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// Frequency is out of the 1-15MHz range (see datasheet)
FrequencyOutOfRange,