From dbc3f581e5fb96e0472a58d23247d267c18a03fd Mon Sep 17 00:00:00 2001 From: Steve Fan Date: Mon, 6 Dec 2021 14:51:46 +0800 Subject: [PATCH] rtio_mgt: capture occurrences of async errors to a global variable --- src/runtime/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index da93f3fb..1a303578 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -42,6 +42,13 @@ mod analyzer; mod irq; mod i2c; +static mut SEEN_ASYNC_ERRORS: u8 = 0; + +pub unsafe fn get_async_errors() -> u8 { + let errors = SEEN_ASYNC_ERRORS; + SEEN_ASYNC_ERRORS = 0; + errors +} fn wait_for_async_rtio_error() -> nb::Result<(), Void> { unsafe { @@ -70,6 +77,7 @@ async fn report_async_rtio_errors() { error!("RTIO sequence error involving channel {}", pl::csr::rtio_core::sequence_error_channel_read()); } + SEEN_ASYNC_ERRORS = errors; pl::csr::rtio_core::async_error_write(errors); } }