mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-02-02 14:36:34 +11:00
Merge pull request #486 from 9names/error_add_debug_traits
Add derive(Debug) and derive(defmt::Format) to error types. pll and xosc Error types didn't implement Debug, which made them annoying to work with. And only a few of our Error types implemented derive(defmt::Format). I added both to all the errors I could find to make things a little more consistent.
This commit is contained in:
commit
9bc48de974
5 changed files with 7 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue