1
0
Fork 0

cxp upconn fw: add proper word printout

cxp upconn fw: fmt
This commit is contained in:
morgan 2024-08-30 13:34:11 +08:00
parent 770d0b159a
commit 0b8f3ba466
1 changed files with 13 additions and 2 deletions

View File

@ -10,10 +10,11 @@ pub fn pipeline_test(timer: &mut GlobalTimer) {
// 0x56, 0x86, 0x5D, 0x6f,
];
const LEN: usize = 20;
const LEN: usize = 4 * 8;
let mut pak_arr: [u8; LEN] = [0; LEN];
unsafe {
// eop = 1 (End of packet) at the last data input
csr::cxp::txcore_din_len_write(arr.len() as u8);
for a in arr.iter() {
@ -30,7 +31,17 @@ pub fn pipeline_test(timer: &mut GlobalTimer) {
i += 1;
}
println!("{:#04X?}", pak_arr);
println!("arr = [");
for i in 0..(LEN / 4) {
println!(
" {:#04X} {:#04X} {:#04X} {:#04X},",
pak_arr[i * 4],
pak_arr[i * 4 + 1],
pak_arr[i * 4 + 2],
pak_arr[i * 4 + 3]
)
}
println!("]")
}
}