From 93b0f0308abee5607efae799039e0f4ccf2914b6 Mon Sep 17 00:00:00 2001 From: Mathis Deroo Date: Mon, 8 Dec 2025 14:08:34 -0800 Subject: Use Result enum for ConvResult structure and read function Signed-off-by: Mathis Deroo --- examples/mcxa/src/bin/adc_interrupt.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/mcxa/src/bin/adc_interrupt.rs b/examples/mcxa/src/bin/adc_interrupt.rs index 9db1173e3..a0e392634 100644 --- a/examples/mcxa/src/bin/adc_interrupt.rs +++ b/examples/mcxa/src/bin/adc_interrupt.rs @@ -62,7 +62,13 @@ async fn main(_spawner: Spawner) { defmt::info!("ADC configuration done..."); loop { - let value = adc.read().await; - defmt::info!("*** ADC interrupt TRIGGERED! *** -- value: {}", value); + match adc.read().await { + Ok(value) => { + defmt::info!("*** ADC interrupt TRIGGERED! *** -- value: {}", value); + } + Err(e) => { + defmt::error!("ADC read error: {:?}", e); + } + } } } -- cgit