From 3d66c5724732eecda27edb8b6ceff39e7b861833 Mon Sep 17 00:00:00 2001 From: MorganTL Date: Tue, 1 Aug 2023 16:59:07 +0800 Subject: [PATCH] - remove debug message - save 1 csr call --- src/runtime/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index fd6ad2c..70c74db 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -108,8 +108,9 @@ static mut LAST_VIRTUAL_LED_STATUS: u8 = 0; #[cfg(all(feature = "target_kasli_soc", has_drtio))] fn wait_for_virtual_leds_change() -> nb::Result<(), Void> { unsafe { - if pl::csr::virtual_leds::status_read() != LAST_VIRTUAL_LED_STATUS { - LAST_VIRTUAL_LED_STATUS = pl::csr::virtual_leds::status_read(); + let current = pl::csr::virtual_leds::status_read(); + if current != LAST_VIRTUAL_LED_STATUS { + LAST_VIRTUAL_LED_STATUS = current; Ok(()) } else { Err(nb::Error::WouldBlock) @@ -124,7 +125,6 @@ async fn async_rtio_led() { let mut io_expander1 = io_expander::IoExpander::new(i2c1, 1).unwrap(); loop { let _ = block_async!(wait_for_virtual_leds_change()).await; - info!("switching"); io_expander0.service().expect("I2C I/O expander #0 service failed"); io_expander1.service().expect("I2C I/O expander #1 service failed"); }