diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-05-17 04:03:23 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-05-17 04:03:23 +0200 |
commit | 75e57273a7ffded0ddcd3698ba68603c4be8a4cd (patch) | |
tree | 8b882cb41073ceadcdc5c27534a2dcc222adfb93 /code/fe310/eos/cell.c | |
parent | 5d157b4f7ecea4793c9da5c33a890d4ea4afc545 (diff) |
power management implemented; net protocol change
Diffstat (limited to 'code/fe310/eos/cell.c')
-rw-r--r-- | code/fe310/eos/cell.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/code/fe310/eos/cell.c b/code/fe310/eos/cell.c index d75e1b9..3ce81f9 100644 --- a/code/fe310/eos/cell.c +++ b/code/fe310/eos/cell.c @@ -9,13 +9,10 @@ #include "cell.h" static eos_evt_handler_t evt_handler[EOS_CELL_MAX_MTYPE]; -static uint16_t evt_handler_flags_buf_free = 0; -static uint16_t evt_handler_flags_buf_acq = 0; static void cell_handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) { if ((buffer == NULL) || (len < 1)) { - eos_evtq_bad_handler(type, buffer, len); - eos_net_free(buffer, 0); + eos_net_bad_handler(type, buffer, len); return; } @@ -23,22 +20,26 @@ static void cell_handle_evt(unsigned char type, unsigned char *buffer, uint16_t if (mtype < EOS_CELL_MAX_MTYPE) { evt_handler[mtype](type, buffer, len); } else { - eos_evtq_bad_handler(type, buffer, len); - eos_net_free(buffer, 0); - return; + eos_net_bad_handler(type, buffer, len); } } +static void cell_handle_rdy(unsigned char type, unsigned char *buffer, uint16_t len) { + // Do nothing + eos_net_free(buffer, 0); +} + void eos_cell_init(void) { int i; for (i=0; i<EOS_CELL_MAX_MTYPE; i++) { - evt_handler[i] = eos_evtq_bad_handler; + evt_handler[i] = eos_net_bad_handler; } eos_net_set_handler(EOS_NET_MTYPE_CELL, cell_handle_evt); + eos_cell_set_handler(EOS_CELL_MTYPE_READY, cell_handle_rdy); } void eos_cell_set_handler(unsigned char mtype, eos_evt_handler_t handler) { - if (handler == NULL) handler = eos_evtq_bad_handler; + if (handler == NULL) handler = eos_net_bad_handler; if (mtype < EOS_CELL_MAX_MTYPE) evt_handler[mtype] = handler; } |