#![no_std] #![no_main] extern crate panic_halt; use core::{arch::asm, ptr::write}; use riscv_rt::entry; mod eth; // use `main` as the entry point of this application // `main` is not allowed to return #[entry] fn main() -> ! { eth::init(); let blink_period = if eth::is_wishbone_correct() { 10_000_000 } else { 500_000 }; // do something here loop { unsafe { //eth::tranmsit(); write_led(0); busy_wait(blink_period); write_led(1); busy_wait(blink_period); } } } fn busy_wait(num_nops: u32) { for _ in 0..num_nops { unsafe { asm!("nop"); } } } fn write_led(val: u32) { unsafe { write(0x01002000 as *mut u32, val); } }