aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMathis Deroo <[email protected]>2025-12-08 14:08:34 -0800
committerMathis Deroo <[email protected]>2025-12-09 10:52:11 -0800
commit93b0f0308abee5607efae799039e0f4ccf2914b6 (patch)
tree7f83d39265c01124e4abe84a0f2632ed5d8ea8e4 /examples
parentff068148fcbc7ea148454cffa81921cc0e0da3e9 (diff)
Use Result enum for ConvResult structure and read function
Signed-off-by: Mathis Deroo <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r--examples/mcxa/src/bin/adc_interrupt.rs10
1 files changed, 8 insertions, 2 deletions
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) {
62 defmt::info!("ADC configuration done..."); 62 defmt::info!("ADC configuration done...");
63 63
64 loop { 64 loop {
65 let value = adc.read().await; 65 match adc.read().await {
66 defmt::info!("*** ADC interrupt TRIGGERED! *** -- value: {}", value); 66 Ok(value) => {
67 defmt::info!("*** ADC interrupt TRIGGERED! *** -- value: {}", value);
68 }
69 Err(e) => {
70 defmt::error!("ADC read error: {:?}", e);
71 }
72 }
67 } 73 }
68} 74}