use csr::virtual_leds for SFP0..3 LED indication #244

Merged
sb10q merged 10 commits from morgan/artiq-zynq:feature into master 2023-08-28 16:08:11 +08:00
2 changed files with 2 additions and 5 deletions
Showing only changes of commit 3a9699589c - Show all commits

View File

@ -119,10 +119,8 @@ fn wait_for_virtual_leds_change() -> nb::Result<(), Void> {
} }
#[cfg(all(feature = "target_kasli_soc", has_drtio))] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
async fn async_rtio_led() { async fn async_rtio_led() {
let i2c0 = unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }; let mut io_expander0 = io_expander::IoExpander::new(unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }, 0).unwrap();
let i2c1 = unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }; let mut io_expander1 = io_expander::IoExpander::new(unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }, 1).unwrap();
let mut io_expander0 = io_expander::IoExpander::new(i2c0, 0).unwrap();
let mut io_expander1 = io_expander::IoExpander::new(i2c1, 1).unwrap();
loop { loop {
let _ = block_async!(wait_for_virtual_leds_change()).await; let _ = block_async!(wait_for_virtual_leds_change()).await;
io_expander0.service().expect("I2C I/O expander #0 service failed"); io_expander0.service().expect("I2C I/O expander #0 service failed");

View File

@ -660,7 +660,6 @@ pub extern "C" fn main_core0() -> i32 {
let mut i2c0 = I2c::i2c0(); let mut i2c0 = I2c::i2c0();
let mut i2c1 = I2c::i2c0(); let mut i2c1 = I2c::i2c0();
i2c0.init().expect("I2C0 initialization failed"); i2c0.init().expect("I2C0 initialization failed");
i2c1.init().expect("I2C1 initialization failed");
let mut io_expander0 = io_expander::IoExpander::new(&mut i2c0, 0).unwrap(); let mut io_expander0 = io_expander::IoExpander::new(&mut i2c0, 0).unwrap();
let mut io_expander1 = io_expander::IoExpander::new(&mut i2c1, 1).unwrap(); let mut io_expander1 = io_expander::IoExpander::new(&mut i2c1, 1).unwrap();