From 4c62ce0dad2f1163171b826c23580dec4af3dce3 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 19 Aug 2019 02:21:36 +0200 Subject: [PATCH] main: restrict eth buffers to 1 each --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5ee2ee5..a204a4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,11 +92,13 @@ fn main() { println!("Eth on"); eth.reset_phy(); - let mut rx_descs: [eth::rx::DescEntry; 8] = unsafe { uninitialized() }; - let mut rx_buffers = [[0u8; 1536]; 8]; + const RX_LEN: usize = 1; + let mut rx_descs: [eth::rx::DescEntry; RX_LEN] = unsafe { uninitialized() }; + let mut rx_buffers = [[0u8; eth::MTU]; RX_LEN]; + const TX_LEN: usize = 1; + let mut tx_descs: [eth::tx::DescEntry; TX_LEN] = unsafe { uninitialized() }; + let mut tx_buffers = [[0u8; eth::MTU]; TX_LEN]; let eth = eth.start_rx(&mut rx_descs, &mut rx_buffers); - let mut tx_descs: [eth::tx::DescEntry; 8] = unsafe { uninitialized() }; - let mut tx_buffers = [[0u8; 1536]; 8]; //let mut eth = eth.start_tx(&mut tx_descs, &mut tx_buffers); let mut eth = eth.start_tx( // HACK