From 404b1628d381cfff1bb737c5bc08b0fc5a3b74fe Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 11 Dec 2019 03:46:40 +0100 Subject: added eos_bufq to msgq; net changed accordingly --- code/fe310/eos/net.c | 52 +++++++++++++++------------------------------------- 1 file changed, 15 insertions(+), 37 deletions(-) (limited to 'code/fe310/eos/net.c') diff --git a/code/fe310/eos/net.c b/code/fe310/eos/net.c index ac2084d..2285ef7 100644 --- a/code/fe310/eos/net.c +++ b/code/fe310/eos/net.c @@ -18,20 +18,14 @@ #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) #define MAX(X, Y) (((X) > (Y)) ? (X) : (Y)) -#define NET_BUFQ_IDX_MASK(IDX) ((IDX) & (EOS_NET_SIZE_BUFQ - 1)) -typedef struct EOSNetBufQ { - uint8_t idx_r; - uint8_t idx_w; - unsigned char *array[EOS_NET_SIZE_BUFQ]; -} EOSNetBufQ; +static EOSBufQ net_buf_q; +static unsigned char *net_bufq_array[EOS_NET_SIZE_BUFQ]; +static unsigned char net_bufq_buffer[EOS_NET_SIZE_BUFQ][EOS_NET_SIZE_BUF]; static EOSMsgQ net_send_q; static EOSMsgItem net_sndq_array[EOS_NET_SIZE_BUFQ]; -static EOSNetBufQ net_buf_q; -static unsigned char net_bufq_array[EOS_NET_SIZE_BUFQ][EOS_NET_SIZE_BUF]; - static uint8_t net_state_flags = 0; static unsigned char net_state_type = 0; static uint32_t net_state_len_tx = 0; @@ -49,26 +43,6 @@ extern uint32_t _eos_spi_state_idx_tx; extern uint32_t _eos_spi_state_idx_rx; extern unsigned char *_eos_spi_state_buf; -static void net_bufq_init(void) { - int i; - - net_buf_q.idx_r = 0; - net_buf_q.idx_w = EOS_NET_SIZE_BUFQ; - for (i=0; i