Skip to content

Commit

Permalink
Merge pull request #655 from ithinuel/fix-uart-debug-add-defmt
Browse files Browse the repository at this point in the history
Add defmt::Format to serial read & always derive Debug
  • Loading branch information
ithinuel authored Jul 22, 2023
2 parents 3b5bbfb + 5b57ba8 commit 6600e44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rp2040-hal/src/uart/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use eh1_0_alpha::serial as eh1;
use eh_nb_1_0_alpha::serial as eh1nb;

/// When there's a read error.
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Debug)]
pub struct ReadError<'err> {
/// The type of error
pub err_type: ReadErrorType,
Expand All @@ -23,7 +25,8 @@ pub struct ReadError<'err> {
}

/// Possible types of read errors. See Chapter 4, Section 2 §8 - Table 436: "UARTDR Register"
#[cfg_attr(feature = "eh1_0_alpha", derive(Debug))]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Debug)]
pub enum ReadErrorType {
/// Triggered when the FIFO (or shift-register) is overflowed.
Overrun,
Expand Down

0 comments on commit 6600e44

Please sign in to comment.