From 1be44e256d61e149e584ea010b0d248700fbc77a Mon Sep 17 00:00:00 2001 From: occheung Date: Wed, 16 Sep 2020 17:46:58 +0800 Subject: [PATCH] fpga config: use include_bytes --- examples/fpga_config.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/fpga_config.rs b/examples/fpga_config.rs index 39c1bb1..ddc069f 100644 --- a/examples/fpga_config.rs +++ b/examples/fpga_config.rs @@ -108,16 +108,19 @@ fn main() -> ! { // Drive SPI_SS_B low fpga_ss.set_low().unwrap(); + let config_data = include_bytes!("../build/top.bin"); + fpga_cfg_spi.transfer(&config_data).unwrap(); + // Send the whole image without interruption - let base_address = 0x08100000; - let size = 135100; - for index in 0..size { - unsafe { - let data :u8 = ptr::read_volatile((base_address + index) as *const u8); - block!(fpga_cfg_spi.send(data)).unwrap(); - block!(fpga_cfg_spi.read()).unwrap(); - } - } + // let base_address = 0x08100000; + // let size = 135100; + // for index in 0..size { + // unsafe { + // let data :u8 = ptr::read_volatile((base_address + index) as *const u8); + // block!(fpga_cfg_spi.send(data)).unwrap(); + // block!(fpga_cfg_spi.read()).unwrap(); + // } + // } // Drive SPI_SS_B high fpga_ss.set_high().unwrap();