forked from M-Labs/zynq-rs
1
0
Fork 0

main: bump RX_LEN/TX_LEN to 2

This commit is contained in:
Astro 2019-09-29 01:39:57 +02:00
parent 644cc64524
commit 378755a0ce
1 changed files with 4 additions and 2 deletions

View File

@ -92,10 +92,12 @@ fn main() {
println!("Eth on"); println!("Eth on");
eth.reset_phy(); eth.reset_phy();
const RX_LEN: usize = 1; const RX_LEN: usize = 2;
let mut rx_descs: [eth::rx::DescEntry; RX_LEN] = unsafe { uninitialized() }; let mut rx_descs: [eth::rx::DescEntry; RX_LEN] = unsafe { uninitialized() };
let mut rx_buffers = [[0u8; eth::MTU]; RX_LEN]; let mut rx_buffers = [[0u8; eth::MTU]; RX_LEN];
const TX_LEN: usize = 1; // Number of transmission buffers (minimum is two because with
// one, duplicate packet transmission occurs)
const TX_LEN: usize = 2;
let mut tx_descs: [eth::tx::DescEntry; TX_LEN] = unsafe { uninitialized() }; let mut tx_descs: [eth::tx::DescEntry; TX_LEN] = unsafe { uninitialized() };
let mut tx_buffers = [[0u8; eth::MTU]; TX_LEN]; let mut tx_buffers = [[0u8; eth::MTU]; TX_LEN];
let eth = eth.start_rx(&mut rx_descs, &mut rx_buffers); let eth = eth.start_rx(&mut rx_descs, &mut rx_buffers);