Compare commits
10 Commits
aa073514b9
...
5279358640
Author | SHA1 | Date |
---|---|---|
MorganTL | 5279358640 | |
MorganTL | e8617e1b82 | |
MorganTL | eef01ea836 | |
MorganTL | 16e9d94afc | |
MorganTL | 29b624a3c9 | |
MorganTL | f15ad8fb0b | |
MorganTL | b5f2c0349f | |
MorganTL | e58dcd0831 | |
MorganTL | c2600c47d9 | |
Sebastien Bourdeauducq | dc08c382a2 |
|
@ -104,29 +104,14 @@ async fn report_async_rtio_errors() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
#[cfg(feature = "target_kasli_soc")]
|
||||||
static mut LAST_VIRTUAL_LED_STATUS: u8 = 0;
|
|
||||||
|
|
||||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
|
||||||
async fn io_expanders_service(
|
async fn io_expanders_service(
|
||||||
i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>,
|
i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>,
|
||||||
io_expander0: RefCell<io_expander::IoExpander>,
|
io_expander0: RefCell<io_expander::IoExpander>,
|
||||||
io_expander1: RefCell<io_expander::IoExpander>,
|
io_expander1: RefCell<io_expander::IoExpander>,
|
||||||
) {
|
) {
|
||||||
loop {
|
loop {
|
||||||
let _ = block_async!((|| -> nb::Result<(), Void> {
|
task::r#yield().await;
|
||||||
unsafe {
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})())
|
|
||||||
.await;
|
|
||||||
|
|
||||||
io_expander0
|
io_expander0
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.service(&mut i2c_bus.borrow_mut())
|
.service(&mut i2c_bus.borrow_mut())
|
||||||
|
@ -192,7 +177,7 @@ pub fn main_core0() {
|
||||||
|
|
||||||
task::spawn(report_async_rtio_errors());
|
task::spawn(report_async_rtio_errors());
|
||||||
|
|
||||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
#[cfg(feature = "target_kasli_soc")]
|
||||||
task::spawn(io_expanders_service(
|
task::spawn(io_expanders_service(
|
||||||
RefCell::new(i2c_bus),
|
RefCell::new(i2c_bus),
|
||||||
RefCell::new(io_expander0),
|
RefCell::new(io_expander0),
|
||||||
|
|
|
@ -640,7 +640,7 @@ pub extern "C" fn main_core0() -> i32 {
|
||||||
unsafe {
|
unsafe {
|
||||||
csr::drtio_transceiver::stable_clkin_write(1);
|
csr::drtio_transceiver::stable_clkin_write(1);
|
||||||
}
|
}
|
||||||
timer.delay_us(20_000); // wait for CPLL/QPLL/MMCM lock
|
timer.delay_us(50_000); // wait for CPLL/QPLL/MMCM lock
|
||||||
let clk = unsafe { csr::sys_crg::current_clock_read() };
|
let clk = unsafe { csr::sys_crg::current_clock_read() };
|
||||||
if clk == 1 {
|
if clk == 1 {
|
||||||
info!("SYS CLK switched successfully");
|
info!("SYS CLK switched successfully");
|
||||||
|
@ -671,7 +671,7 @@ pub extern "C" fn main_core0() -> i32 {
|
||||||
for mut rep in repeaters.iter_mut() {
|
for mut rep in repeaters.iter_mut() {
|
||||||
rep.service(&routing_table, rank, &mut timer);
|
rep.service(&routing_table, rank, &mut timer);
|
||||||
}
|
}
|
||||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
#[cfg(feature = "target_kasli_soc")]
|
||||||
{
|
{
|
||||||
io_expander0
|
io_expander0
|
||||||
.service(&mut i2c)
|
.service(&mut i2c)
|
||||||
|
@ -717,7 +717,7 @@ pub extern "C" fn main_core0() -> i32 {
|
||||||
for mut rep in repeaters.iter_mut() {
|
for mut rep in repeaters.iter_mut() {
|
||||||
rep.service(&routing_table, rank, &mut timer);
|
rep.service(&routing_table, rank, &mut timer);
|
||||||
}
|
}
|
||||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
#[cfg(feature = "target_kasli_soc")]
|
||||||
{
|
{
|
||||||
io_expander0
|
io_expander0
|
||||||
.service(&mut i2c)
|
.service(&mut i2c)
|
||||||
|
|
Loading…
Reference in New Issue