- remove debug message

- save 1 csr call
MorganTL 2023-08-01 16:59:07 +08:00
parent 10cfd8fc50
commit 3d66c57247
1 changed files with 3 additions and 3 deletions

View File

@ -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");
}