summaryrefslogtreecommitdiff
path: root/code/fe310
diff options
context:
space:
mode:
Diffstat (limited to 'code/fe310')
-rw-r--r--code/fe310/eos/net.c16
-rw-r--r--code/fe310/eos/net.h3
-rw-r--r--code/fe310/eos/net_def.h3
3 files changed, 11 insertions, 11 deletions
diff --git a/code/fe310/eos/net.c b/code/fe310/eos/net.c
index f3a82b8..ac2084d 100644
--- a/code/fe310/eos/net.c
+++ b/code/fe310/eos/net.c
@@ -18,19 +18,19 @@
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
-#define NET_BUFQ_IDX_MASK(IDX) ((IDX) & (NET_SIZE_BUFQ - 1))
+#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[NET_SIZE_BUFQ];
+ unsigned char *array[EOS_NET_SIZE_BUFQ];
} EOSNetBufQ;
static EOSMsgQ net_send_q;
-static EOSMsgItem net_sndq_array[NET_SIZE_BUFQ];
+static EOSMsgItem net_sndq_array[EOS_NET_SIZE_BUFQ];
static EOSNetBufQ net_buf_q;
-static unsigned char net_bufq_array[NET_SIZE_BUFQ][NET_SIZE_BUF];
+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;
@@ -53,8 +53,8 @@ static void net_bufq_init(void) {
int i;
net_buf_q.idx_r = 0;
- net_buf_q.idx_w = NET_SIZE_BUFQ;
- for (i=0; i<NET_SIZE_BUFQ; i++) {
+ net_buf_q.idx_w = EOS_NET_SIZE_BUFQ;
+ for (i=0; i<EOS_NET_SIZE_BUFQ; i++) {
net_buf_q.array[i] = net_bufq_array[i];
}
}
@@ -175,7 +175,7 @@ static void net_handler_xchg(void) {
_eos_spi_state_len = ((_eos_spi_state_len + 2)/4 + 1) * 4 - 2;
}
- if (_eos_spi_state_len > NET_SIZE_BUF) {
+ if (_eos_spi_state_len > EOS_NET_SIZE_BUF) {
SPI1_REG(SPI_REG_CSMODE) = SPI_CSMODE_AUTO;
SPI1_REG(SPI_REG_IE) = 0x0;
}
@@ -222,7 +222,7 @@ void eos_net_init(void) {
int i;
net_bufq_init();
- eos_msgq_init(&net_send_q, net_sndq_array, NET_SIZE_BUFQ);
+ eos_msgq_init(&net_send_q, net_sndq_array, EOS_NET_SIZE_BUFQ);
for (i=0; i<EOS_NET_MAX_MTYPE; i++) {
evt_handler[i] = eos_evtq_bad_handler;
}
diff --git a/code/fe310/eos/net.h b/code/fe310/eos/net.h
index e0fdbf9..982ee1b 100644
--- a/code/fe310/eos/net.h
+++ b/code/fe310/eos/net.h
@@ -1,6 +1,9 @@
#include <stdint.h>
#include "event.h"
+#define EOS_NET_SIZE_BUF 1500
+#define EOS_NET_SIZE_BUFQ 2
+
#define EOS_NET_FLAG_BACQ 0x1
#define EOS_NET_FLAG_BFREE 0x2
diff --git a/code/fe310/eos/net_def.h b/code/fe310/eos/net_def.h
index e38216d..ec795b1 100644
--- a/code/fe310/eos/net_def.h
+++ b/code/fe310/eos/net_def.h
@@ -1,6 +1,3 @@
-#define NET_SIZE_BUF 1500
-#define NET_SIZE_BUFQ 2
-
#define NET_PIN_RTS 20
#define NET_PIN_CTS 22