From ccb3a1ba40c0a4ae88abe6e449d25833432be3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Quentin?= Date: Wed, 6 Nov 2024 12:43:25 +0100 Subject: [PATCH] Use `diagnostic` on `DmaChannelConvert` (#2465) * Use `diagnostic` on `DmaChannelConvert` * Typo --- esp-hal/src/dma/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esp-hal/src/dma/mod.rs b/esp-hal/src/dma/mod.rs index f91b18d1da..c759f6a6cc 100644 --- a/esp-hal/src/dma/mod.rs +++ b/esp-hal/src/dma/mod.rs @@ -1593,6 +1593,11 @@ pub trait DmaChannelExt: DmaChannel { fn get_tx_interrupts() -> impl InterruptAccess; } +#[diagnostic::on_unimplemented( + message = "The DMA channel isn't suitable for this peripheral", + label = "This DMA channel", + note = "Not all channels are useable with all peripherals" +)] #[doc(hidden)] pub trait DmaChannelConvert: DmaChannel { fn degrade_rx(rx: Self::Rx) -> DEG::Rx;