From 75e57273a7ffded0ddcd3698ba68603c4be8a4cd Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 17 May 2020 04:03:23 +0200 Subject: power management implemented; net protocol change --- code/fe310/eos/sock.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'code/fe310/eos/sock.c') diff --git a/code/fe310/eos/sock.c b/code/fe310/eos/sock.c index 5e3dc67..720e620 100644 --- a/code/fe310/eos/sock.c +++ b/code/fe310/eos/sock.c @@ -9,21 +9,18 @@ #include "sock.h" static eos_evt_handler_t evt_handler[EOS_SOCK_MAX_SOCK]; -static uint16_t evt_handler_flags_buf_free = 0; -static uint16_t evt_handler_flags_buf_acq = 0; static void sock_handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) { unsigned char sock; if ((buffer == NULL) || (len < 2)) { - eos_evtq_bad_handler(type, buffer, len); - eos_net_free(buffer, 0); + eos_net_bad_handler(type, buffer, len); return; } sock = buffer[1]; if ((sock == 0) || (sock > EOS_SOCK_MAX_SOCK)) { - eos_evtq_bad_handler(type, buffer, len); - eos_net_free(buffer, 0); + eos_net_bad_handler(type, buffer, len); + return; } sock--; @@ -32,8 +29,7 @@ static void sock_handle_evt(unsigned char type, unsigned char *buffer, uint16_t evt_handler[sock](type, buffer, len); break; default: - eos_evtq_bad_handler(type, buffer, len); - eos_net_free(buffer, 0); + eos_net_bad_handler(type, buffer, len); break; } } @@ -42,13 +38,13 @@ void eos_sock_init(void) { int i; for (i=0; i