experiments: don't write raw blocks to the sdcard by default

This commit is contained in:
Astro 2020-06-26 23:27:28 +02:00
parent a16c639eaf
commit ec252b099c

View File

@ -41,7 +41,7 @@ const HWADDR: [u8; 6] = [0, 0x23, 0xde, 0xea, 0xbe, 0xef];
pub fn main_core0() { pub fn main_core0() {
// zynq::clocks::CpuClocks::enable_io(1_250_000_000); // zynq::clocks::CpuClocks::enable_io(1_250_000_000);
println!("\nzc706 main"); println!("\nzc706 main");
ps7_init::apply(); // ps7_init::apply();
libboard_zynq::stdio::drop_uart(); libboard_zynq::stdio::drop_uart();
libboard_zynq::logger::init().unwrap(); libboard_zynq::logger::init().unwrap();
@ -93,16 +93,13 @@ pub fn main_core0() {
}; };
const SIZE: usize = 512 * 2 + 1; const SIZE: usize = 512 * 2 + 1;
let mut sd_card = result.unwrap(); let mut sd_card = result.unwrap();
{ if false {
let buffer: [u8; SIZE] = [5; SIZE]; let buffer: [u8; SIZE] = [5; SIZE];
sd_card.write_block(0x0, 2, &buffer).unwrap(); sd_card.write_block(0x0, 2, &buffer).unwrap();
} }
let mut buffer: [u8; SIZE] = [0; SIZE]; let mut buffer: [u8; SIZE] = [0; SIZE];
sd_card.read_block(0x1, 2, &mut buffer[1..]).unwrap(); sd_card.read_block(0 /*0x1*/, 2, &mut buffer[1..]).unwrap();
for i in 0..buffer.len() { info!("buffer = {:?}", &buffer[..]);
info!("buffer[{}] = {}", i, buffer[i]);
}
info!("End");
} }
let mut flash = zynq::flash::Flash::new(200_000_000).linear_addressing_mode(); let mut flash = zynq::flash::Flash::new(200_000_000).linear_addressing_mode();