From 5b57ba8b4b091f8f54c8cb1c5b363a0ea4ba1f1b Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Sat, 22 Jul 2023 19:38:11 +0100 Subject: [PATCH] Add defmt::Format to serial read & always derive Debug --- rp2040-hal/src/uart/reader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rp2040-hal/src/uart/reader.rs b/rp2040-hal/src/uart/reader.rs index 7ba882af1..dc729897d 100644 --- a/rp2040-hal/src/uart/reader.rs +++ b/rp2040-hal/src/uart/reader.rs @@ -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, @@ -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,